Sunday, December 18, 2011
Mac 10.7, python-ldap, MySQL-python, homebrew
Wednesday, November 9, 2011
RHEL6 latency on Dell M610: C States
We ran into latency problems on Dell M610 servers using RHEL6 while RHEL5 performed perfectly. The RHEL6 stock kernel has a module called intel_idle which ignores Dell's BIOS settings to disable C-states. We've set the following in the tail of the boot line in /etc/grub.conf and so far so good.
intel_idle.max_cstate=0 processor.max_cstate=1When I started here six years ago we had a DNS server with a similar problem solved basically the same way; with a "acpi=off" to disable ACPI.
Update: The above seems to have helped servers connected to the SAN but not one which just uses the local disk. RedHat had some interesting tweaks to try with MegaCli, hdparm, and the scheduler as they think it's IO related:
Set policy to cache data:
# MegaCli64 -LDSetProp -Cached -LAll -aAllEnable disks' cache:
# MegaCli64 -LDSetProp EnDskCache -LAll -aAll # MegaCli64 -LDSetProp ADRA -LALL -aALLEnable write cache, but first verify if the controller is battery backed:
# MegaCli64 -AdpBbuCmd -GetBbuStatus -a0 | grep -e '^isSOHGood' -e '^Charger Status'If the above results display no BBU, do not proceed.
If we have a battery backed controller, enable write cache.
# MegaCli64 -LDSetProp WB -LALL -aALLIf battery fails or is discharged, disable write cache:
# MegaCli64 -LDSetProp NoCachedBadBBU -LALL -aALLVerify policy is Enabled:
# MegaCli64 -LDInfo -LAll -aAll |grep 'Disk Cache'Disk Cache Policy: Enabled
Disable local device caching:
# hdparm -W0 /dev/sda- Add the above to /etc/rc.local to persist reboots.
Edit /etc/fstab and modify the mount options, ie: /dev/mapper/vg_root-lv_root / ext4 defaults,nobarriers,data=writeback 1 1 ... ...The filesystem(s) would need be remounted for changes to take effect.
Next, we will change the scheduler to Deadline.
# echo 'deadline' > /sys/block/sda/queue/scheduler # echo 200 > /sys/block/sda/queue/iosched/read_expire # echo 500 > /sys/block/sda/queue/iosched/write_expire- Add the above commands to /etc/rc.local to persist reboots.
Monday, October 31, 2011
KVM PCI device assignment
Update: Turns out this was not a good idea since the VM would monopolize the device on the physical machine; e.g. the VM would get an HBA to the SAN.
Update 2: Using NPIV seems to be the right thing for this.
Monday, October 10, 2011
MySQL: replace into
Monday, September 26, 2011
web.py on Mac OS X 10.7
$ sudo easy_install web.py Password: Searching for web.py Reading http://pypi.python.org/simple/web.py/ Reading http://webpy.org/ Best match: web.py 0.36 Downloading http://pypi.python.org/packages/source/w/web.py/web.py-0.36.tar.gz#md5=3f9ee778c5c34357a0233c1f0e024d00 Processing web.py-0.36.tar.gz Running web.py-0.36/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qC65Ak/web.py-0.36/egg-dist-tmp-CjDoLl zip_safe flag not set; analyzing archive contents... web.application: module references __file__ web.debugerror: module references __file__ Adding web.py 0.36 to easy-install.pth file Installed /Library/Python/2.7/site-packages/web.py-0.36-py2.7.egg Processing dependencies for web.py Finished processing dependencies for web.py $You might also be interested in Setting up PHP & MySQL on OS X 10.7 Lion to get it working with MySQL.