Learn to share

Linux QA: 102

| Comments

What is the difference between group and cgroup

group apply filesystem permissions to different users, while cgroup lets you limit or reserve resources

Explain SIGUSR1 signal

It is user defined signal #1

Does GPT has extended or logical partitions


grep -ril foo bar - What do flags ril mean?

r=recursive i=case insensitive l=print

Explain the difference between Emulated NIC and Paravirtualized NIC

Emulated NIC simulates the behavior of specific hardware for which guests will already have a builtin driver. Paravirtualized NIC copies data into a buffer and alerts the guest or host, which it then copies out.

Does SR-IOV improves network throughput?

Yes. SR-IOV reduces the amount of copying through buffers by using part of PCIe specification to let the guest OS talk directly to the physical NIC.

What is AES-NI

AES-NI is hardware implementation of AES found in high end Intel CPUs.

How to verify the allocated memory on virtual machine

If your Linux distribution has dmidecode, one way to verify the allocated memory - dmidecode -t memory | grep ‘Size:’

TCP Window Scaling: 101

| Comments

TCP window scaling adjusts how many un-acked packets can be in transit before it stops and waits for an ack.

On a high latency connection (like one over the Internet), a very small window would slow it to a crawl. The sender would send a couple packets, then wait a long while for the ack before sending more. However if that connection also corrupts packets now and then, too large a window is bad too. On an error, the receiver sends a nack, then drops subsequent packets. The sender then retransmits everything from that packet onward. The larger the window the more has to be re-sent.

So the kernel automatically scales the window size. It begins with a default size. Then if it ends up waiting for acks before sending more, it increases the size because of high latency. But then if there’s an error and it has to retransmit, it decreases the size. The idea is to dynamically tend toward an optimal size for this particular connection.

Intro to 70-persistent-net and 75-persistent-net-generator: Rules

| Comments

70-persistent-net.rules is a generated file that remembers NICs by MAC address and/or where on the bus they’re connected while 75-persistent-net-generator.rules is a static file that generates and updates it.

For an example, When new NIC is discovered, 75-persistent-net-generator.rules names it and adds a rule to 70-persistent-net.rules that will give it that name automatically each time it’s enumerated.

70 has a lower number than 75 in order to run first. 70 will catch any NICs it recognizes, then 75 will take anything that hasn’t already been named and generate a new name for it.

This is quite nice, if you’ve assigned static configs to a bunch of NICs and then changed the hardware configuration so that they would normally be renumbered. It’s also a lifesaver if you have one of the rare weird hardware configurations that doesn’t enumerate in the same order every boot. However if you replace a NIC, the new one gets a new name so you have to update config files.

Dirty Memory: Basics

| Comments

Dirty memory is disk write cache. When you write to files, it creates dirty memory that is then flushed to disk at the I/O scheduler pace.

As a next step, lets see the current dirty memory values set on my virtual server.

sysctl -a | grep dirty
vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 10
vm.dirty_bytes = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_ratio = 30
vm.dirty_writeback_centisecs = 500

Cool, so at more than 10% of system RAM used for dirty pages, it will begin flushing in the background. At 30%, writes will start to block.

vm.dirty_background_ratio lets you allocate more dirty memory if needed. It’s how much dirty memory to allow before starting a flush. Please be aware, if you have more dirty memory sitting around, the more you lose if the system goes hard shutdown.

vm.dirty_ratio defines hard value. After hitting 30%, it will block until some data has been committed to disk.

vmdirty_expire_centisecs is how long dirty memory can stay before the system flushes it to disk regardless.

vm.dirty_writeback_centisecs is just how often it checks whether it needs to do anything.

Depending upon the use case, you can tune the parameters to meet your requirements.

User Network Profile: Windows 10

| Comments

The goal of this post is to view basics on user wifi profiles using netsh. In windows 10, open command prompt as administrator and type netsh. Then switch to wlan context by typing wlan

To list the current profiles

netsh wlan> show profiles

To view profile details

netsh wlan> show profiles name=profilename

To delete a profile

netsh wlan> delete profile name=profilename