Tag Archives: apache

Storing images on file system vs database

While researching efficient methods of storing large numbers of images on my server, I came across this post detailing the process of returning an image from a mysql server. The process described is common, except that it is inspected at a much lower level, complete with mode switching between kernel and user on a linux server:

Your systems network buffer fills with a new packet containing a new request from the network card. The system delivers the packet to your Apache, switching from kernel mode into user mode.

Apache processes the packet, handing it internally to its mod_php for processing. The mod_php parses the request, constructing a SQL query for the image blob, and pushes the SQL query into a kernel buffer, switching from user mode into kernel mode.

Check out the full post at http://mysqldump.azundris.com/archives/36-Serving-Images-From-A-Database.html

Apache Error #28 – No space left on device

The Apache server on my EC2 instance stopped suddenly and refuses to restart. Repeating in the error log is this misleading error:

(28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed

A quick check with df -h and repquota -v indicates that there are plenty of disk left and no user is over his quota. The culprit turns out to be left over semaphore arrays. To check whether they exist on your system, use

ipcs -s | grep apache

In my case this returns a shocking 128 left overs. To clear them, run

Continue reading