Blog Links

Quick dirty fix to speed up qmail for bulk mailings

We were getting around 2 mails per second with qmail for a bulk emailing, which was not fast enough and rather than try and patch qmail to fix a bunch of problems,  we chose to put the qmail queue on a temporary file system.

It appears that one of qmails bottlenecks is disk access (so perhaps noatime and other fixes for ext3 filesystem might also help), We used a 500meg temp disk, which seemed plenty big enough, actually you could probably get away with 50meg, Once set up use linux “df” command to monitor the usage.

After moving to the temp disk we were getting aroung 6 messages per second.

Here is the procedure we used to create a temporary file system and mount it in the correct place.

First stop qmail

service qmail stop
or
/etc/init.d/qmail stop

rename the queue

mv /var/qmail/queue /var/qmail/queue_original

make a new mount point

mkdir /var/qmail/queue

make the temp filesystem and mount it (here we make a 500mb disk)

mount -t tmpfs -o size=500M,mode=0744 tmpfs /var/qmail/queue/

Copy the old queue data (with owner & permissions in-tact)  to the new temp filesystem

cp -pR /var/qmail/queue_original/ /var/qmail/queue/

Make the file permissions on /var/qmail/queue the same as/var/qmail/queue_original using chmod & chown

in my case

chown qmailq:qmail /var/qmail/queue
chmod 750 /var/qmail/queue

Now restart qmail

service qmail start
or
/etc/init.d/qmail stop

That should do it, if your server crashes you’ll probably mess up qmails queue, but you can always remove the temp disk and rename  your queue_original back to queue. Obviously after a reboot qmail will have no queue so you will need to either set it back to how it was before the temporary file system, or re-initialize the temporary file system with a copy of the original queue

Chris

If this has been useful to you, and you would like to buy me a coffee, or help towards my monthly server costs please click here to make a donation via paypal.

How much disk space is “all” the music

I wanted to know how much disk space all the music ever released would take up and couldnt find an approximation, so I put together this to give me a ball park figure.
If you add up all the abums on
http://en.wikipedia.org/wiki/Category:Albums_by_year
It gives 81,708
At around 4mb per track and 10 tracks per album thats
81708*4MBytes*10 = 3268320 MBytes
3268320 [...]

F100 Technical Fault on Meile W3824WPS Washing machine

I’ve got a Miele W3824WPS washing machine, and I accidentally forgot to close the drain door at the bottom of the washing machine when doing a regular clean. This triggered an error “Technical  F100″  Fault nothing seemed to clear the error and I couldn’t find anything on the Internet about it. After a little but [...]

SQLite V3 with PHP – sample script

sqlite

SQLite [http://www.sqlite.org] is a very handy tool, essentially it creates a database in a file. SQLite V3 should be installed automatically with PHP5.
I find SQLite very handy when I want to make standalone code that uses a database, and because it doesn’t require an external application(such as Mysql) it makes it very portable. [...]

An easy way to use GNU Screen over SSH

heckert_gnusmall

GNU Screen is a free terminal multiplexer developed by the GNU Project since at least 1995. It allows a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. It is useful for dealing with multiple programs from the command line, and for separating programs from the shell that [...]