FirstServed Tech Blog - FirstServed and the Art of Server Tuning

Posts Tagged ‘apache’

Sorting Apache access_logs

Tuesday, May 24th, 2011

When working in a clustered environment you might encounter situations where you need to sort merged access_logs from 2 different servers for one website. In this case the timestamps may not be ordered corretly due to time offsets in the individual servers or delays in the logging proces. The ordered data is needed since some statistics processing engines expect correctly sorted data.

The sorting can easily be done by the following command:

sort -t ' ' -k 4.9,4.12n -k 4.5,4.7M -k 4.2,4.3n -k 4.14,4.15n -k 4.17,4.18n -k 4.20,4.21n access_log.1 > access_log.1.sorted

Adjust, change and implement to match your own personal preference!

Speeding up drupal hosting by setting up a quality LAMP environment

Wednesday, July 8th, 2009

One of our customers works with drupal… Unless you are from another planet, you know drupal is currently one of the leading open source CMS systems with nice features, but it also is quite a bottleneck on server performance. Not to mention the load on a database server etc…

We suggest drupal hosting customers to opt for a virtual server setup. Does this mean you can’t host drupal on a shared hosting platform? Not at all, but if you have a high load website, a isolated server instance might give you some advantages.This means you can set up a nice isolated environment for a Drupal driven CMS website with dedicated server performance at severe reduced cost.

When setting up the environment be sure to run through the following checklist:

  • CentOS 5.3 (for example)
  • Apache 2.2 webserver
  • MySQL 5+ database server
  • PHP 5+
  • and, very important: eAccelerator 9.5.3 or higher.

Why the eAccelerator? Well, Drupal uses a lot of cached pages. Enabling Drupal caching already gives you a boost but installing eAccelerator makes sure frequently used php scripts are stored in a compiled state thus allow retrieval faster.

On top of that, you may optimize the MySQL query_caching settings, as they Drupal also uses a lot of the same queries.

You can find the latest version of eAccelerator here: http://eaccelerator.net/