Category Archives: Linux

linux

Compile Owncloud libocsync0 for Debian Wheezy from source

Posted on .

I was trying to get the Python Owncloud CLI package to work on Wheezy. It requires libocsync0 which is available in unstable but it has many depends that would push the box further into unstable than I would of liked (samba and sftp plugins require unstable versions of samba, ssh, libc6, etc.).

To get libocsync working on wheezy, I did the following:

Windows 7 on XEN HVM — Slow Remote Desktop

Posted on .

Update: The same issue and fix are relevant for Windows Server 2008 R2, Server 2012 and Windows 8. Maybe all versions of Windows using the GPL PV drivers.

I just installed a Windows 7 guest onto a Debian Wheezy Xen dom0. I installed these GPLPV drivers v11.0.372. Using RealVNC to setup the machine was fast and responsive, however once I switched over to RDP the machine was acting like a mule. The RDP session was slowly redrawing the screen as each new application loaded. Internet Explorer’s default MSN page with its ever changing news feed image was causing the session to almost lock up.

The fix is to disable Large Send Offload on the Xen network adapter.
 
devmgmt_xen

Simple instructions:

  1. Press the Start Orb
  2. Type: “devmgmt.msc” and press enter
  3. In device manager, find Network Adapters
  4. Right click, “Xen Net Device Driver” and choose Properties
  5. Under the advanced tab, click “Large Send Offload” and adjust the Value to “Disabled”
  6. Click Okay (if you did this via RDP, you will lose the connection as the network is reset, just reconnect)

logcheck — various filters


As mentioned earlier, I have a few of these logcheck filters I have created over the past few years. I use Debian and CentOS so other distros may not perfectly match.

These work in conjunction with the default filters, hence their naming scheme of local_<service>.

Dovecot
login, logout, mysql connections, lda delivery, ssl regen

  local_dovecot (1.5 KiB, 2,455 hits)

Managesieve (part of Dovecot)
login, logout

  local_managesieve (320 bytes, 2,401 hits)

OpenVPN
login related

  local_openvpn (506 bytes, 2,407 hits)

PostFWD
statistic log lines: dnsbl, rules, stats, cache, rate

  local_postfwd (104 bytes, 2,464 hits)

ProFTPd mod_ban (optional module)
obtained, detached, removed, showing ban list

  local_proftpd-banlog (230 bytes, 2,234 hits)

rSYSlog
start, exit, reload/hup, mark

  local_rsyslog (954 bytes, 2,391 hits)

OpenSSH
closed user request, closed preauth 127.0.0.1

  local_ssh (255 bytes, 2,415 hits)

swapspace
allocating, retiring, adding (kernel)

  local_swapspace (324 bytes, 2,378 hits)

Xen vs OpenVZ

Posted on .

Some things I have been able to measure after I changed from OpenVZ to Xen.

BackupPC has 62 hosts reporting “Pool is 348.76GB comprising 2086499 files and 4369 directories” using 6.5mil inodes on XFS on its own separate set of disks.

Load during BackupPC usage on OpenVZ used to send the host into a frenzy of 10+, with the guest at 2-3. Whilst BackupPC was running, all guests felt sluggish.
Load with Xen has the host and all other VMs completely unaffected, and the guest at 3-5.

BackupPC nightly takes 2x the time on Xen than it does on OpenVZ. I have adjusted the nightly to be split up over 2 days instead of all in 1.

All backups are taking ~20% longer with Xen.

Memory usage on the host with OpenVZ used to climb to 12GB+ (out of 16GB total) when BackupPC nightly was running, and then slowly dissipate during the day. The memory usage wasn’t in the cache/buffer section either, it was marked as actually in use. However no application was using all that RAM. The RAM being used was listed as “slab” RAM (tip: run “slabtop”) which is what XFS uses as cache, however the free command sees the RAM as used which is confusing. I think as the host had 14GB+ free most the time, it used as much as it could.

Memory usage on the host whilst using Xen was obviously not affected by the BackupPC guest. BackupPC guest total RAM is only 2GB, so memory usage would climb to 1.5GB, in line with expectations. 1GB+ of this was slab memory.

In general I have noticed most VMs to feel slower with Xen, especially with disk read/writes. However hdparm tests show raw throughput has remained unchanged (~80MB/s). I have noticed though that when another VM is busy, the other guests have no noticeable reduction in performance on Xen. This was my main reason for switching, as BackupPC was bringing all other guests to a near halt on OpenVZ.

I think the reason for the reduction in performance is the fact each guest has to manage its own disk cache whilst during OpenVZ, the majority of data was mounted on the host with plenty of free RAM available for caching. This is a fundamental difference between containers and hypervisors.

I have reduced MySQL guest RAM from 4GB to 1GB. The Zabbix database alone is 14GB, but in all I haven’t noticed any noticeable difference in performance for Zabbix, or its frontend with both the move to Xen and the RAM change. The daily-backup on the SQL server (backup all databases) takes 50% longer to complete (~1min, now ~1m40s).

The small number of timed tests I could compare from one to the other may show a performance loss on Xen, but with this being a true hypervisor system, it was expected. I didn’t expect BackupPC to suffer as much as it did during the nightly, but I believe this to be because it no longer has the freedom of 14GB free RAM to use as cache.

I have also lost the RAM flexibility that comes with OpenVZ, but overall I am happy with the move back to Xen. I moved to OpenVZ as my DVB-T card didn’t function when booting on the Xen kernel, but I plan to replace MythTV with a Sky box in the near future and was getting frustrated with BackupPC on OpenVZ.

logcheck — amavisd-new filter

Posted on .

Tested using Debian 7 Wheezy. To be added to /etc/logcheck/ignore.d.server/

With javascript enabled, the above regex block has a toolbar with a copy-to-clipboard button.

I have quite a few of these custom filters, I’ll post some more at another time.