This page has been translated from English

Articles Comments

Guatewireless.org » Articles , Case Study , Debian , Internet , Linux " Optimizing the Web server: Apache 2 vs. Lighttpd 1.x

Optimizing Web server: Apache 2 vs. Lighttpd 1.x

Case Study: How to optimize Web services

For many years I worked with the Apache web server to version 2.2.4-3.

A couple of weeks ago a client asked me advice to buy new hardware to another web server, since the current did not have enough memory to support and intranet web sites on Apache with MySQL.

In analyzing the case, I realized I was receiving an average of 5mil visits, totaling about 15mil hits a day. Access to the pages locally was in itself quite slow, as the lamp was at full capacity using the swap and the database was not to rough with the consultations.

The first was to optimize the database, removing all trash and recreating the indexes. This will release 12% of memory, which quickly consumed the Apache 2. With this behavior, I decided to try a lighter web server, the response: lighttpd.

The problem is that when you start apache load all modules it contains, and many of these never come to be used by our applications. Of course you can remove these modules, but there are some who are critical to the operation of our application, and libapache2-mod-php.

For the php module, it is loaded into memory is called for each request that the server receives, say a user enters our site and when loading has to go through the images of the same, apache all calls to PHP their libraries for this action. This saturates the server memory quickly.

The solution to mod-php-cgi is fast, this module only loads the PHP libraries needed for each action from demonized processes, and maintains such processes to be reused for multiple requests. This solves the consumption of CPU cycles to save the creation of new instances or CGI processes.

In the end, the installation of lighttpd with PHP support via Fast-CGI demonstrated an instant improvement in site response. Previously it took to load each page from 5 to 30 seconds, were now deployed in less than 3.

The use of memory under 50%, giving us room to grow.

All this burden off the processor, thus obtaining a faster response to queries on MySQL databases

Now we see the howto on how to install lighttpd on our Linux server.

Popularity: 3% [ ? ]

Written by

Passionate about home technology, music, free software and community networks.

Filed under: Articles , Case Study , Debian , Internet , Linux

Leave a Reply

*

You may use HTML tags and attributes These: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Search Terms

  • lighttpd vs apache (34)
  • lighttpd vs apache (13)
  • apache2 vs lighttpd (11)
  • lighttp vs apache (1)
  • apache on windows optimization (1)
  • vrs apache lighttpd (1)
  • lighthttpd vs apache2 (1)
  • apache lighttpd response difference (1)
  • 2 which is better apache or lighttpd (1)
  • apache2 vs lighttpd (1)
  • lighttpd vs apache server images (1)
  • Apache and Lighttpd server (1)

  • Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 34903453 bytes) in / home / guatewireless / site / wp-content / plugins / google-bot-bling / google-bot-bling.php on line 114