[Typo3-dev] eaccelerator benchmarking

Steffen Müller steffen at mail.kommwiss.fu-berlin.de
Mon Nov 28 03:49:39 CET 2005


Hi.

Thanks to Stuckis excellent eaccelerator package for Debian, I decided
to switch from APC to eaccelerator. I played around a bit with the
configuration and wondered, what values are best to use with TYPO3. I
did not focus on speed, but memory consumption. Here's a report about
my experiences.

My main question was how much memory does eaccelerator consume with
TYPO3 (I use the term memory as a synonym for shm). The goal was to find
some basic rules for different demands, mainly based on
eaccelerator.shm_size. One restriction was not to use the harddisk to
achieve a slightly better speed:
# eaccelerator.shm_only="1"

I did five different tests, using the eaccelerator.php script for
measurements:

1) I started my browser and requested randomly some pages of one of my
websites (with a few FE plugins). After that I quickly clicked through
most standard BE Modules. Just like everyday work. Meanwhile I watched
the allocated memory. It quickly grew up to 34MB.

2) In the next test, I requested a few pages of two websites without
accessing the BE. The sites use a bunch of FE plugins (ms_survey,
julle_events, tt_news, indexed_search, css_styled_content). The result
was about 16MB.

3) Then I tried some more load: FE and BE requests of three different
websites. The above mentioned plugins of the two websites and the
quickstart package. I used three different TYPO3-sources to see if it
increases the load. Additionally, I rushed through the install tool of
one site. >64MB. Whooo, pretty much.

To give you some more or less reliable and objective date, these are
some results from the latest quickstart package (+3.8.1 sources):

4) FE only access of all pages of the quickstart package:
Memory Allocated	8,857,316 Bytes
Cached Scripts		52

5) BE only access of all modules & actions of the quickstart package:
Memory Allocated	26,365,868 Bytes
Cached Scripts		341

I did not even use GDlib in these tests.


Facts summary:
- Using different versions of sources multiplies the load.
- Based on the quickstart package as an average website, the FE
rendering process uses about 8MB. Additional FE-Plugins need more memory.
- Based on the quickstart package as an average website, the use of all
BE modules/functions uses about 26MB. Additional BE-Plugins need more
memory.
- Usually, a BE session consumes more memory than a FE session, but is
less frequently accessed (pageimpressions > BE hits; FE user > BE user)
- In most cases, it is possible to measure the total amount of needed
memory on a webserver.

Recommodations:
- If you cannot spend enough memory for shm (as a rule <32MB), a
solution would be to cleanup scripts by short TTL values or even
completely turn off eaccelerator for the BE (see below).
- If you have more than one website, you can reduce load by using the
same source directory for all sites.
- Test your requirements. Increase the amount of memory until the limit
of needed memory is reached. Then reconfigure your php.ini.

Configuration hints:
To cleanup memory, delete all memory objects which have not been
accessed e.g. in the last 30 minutes once shm is full:
# eaccelerator.shm_ttl="1800"

To turn eaccelerator off in the BE, add the following two lines in
./typo3/.htaccess:
# php_flag eaccelerator.enable 0
# php_flag eaccelerator.optimizer 0

To spend 32MB for eaccelerators shm, add this line to your php.ini
# eaccelerator.shm_size="32"
Notice: The 2.6 kernel does not allow more than 32 MB shm by default. To
use more memory, you have to alter /proc/sys/kernel/shmmax (see
eaccelerator FAQ).

Does anyone have other experiences (or even a more detailed benchmark)
with eaccelerator? Speed messurements?

-- 
cheers,
Steffen

P.S.
Here's the eaccelerator part of my php.ini: (I use Debian Sarge with a
2.4 kernel, 1GB RAM)

zend_extension="/usr/lib/php4/20020429/eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl=3600"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="1"
eaccelerator.compress="1"




More information about the TYPO3-dev mailing list