In everyday use and in kinematics, the speed of an object is the magnitude of its velocity (the rate of change of its position); it is thus a scalar quantity. read more at WikiPedia

  • Since I am facing performance problem due to the load of visitors and a badly configured server, I decide today to document my findings in this new series of articles.

    As soon as PHP run as FastCGI and no more inside an Apache module (mod_php4.so is not multi threaded), You should be able to switch the default MPM setting of Apache from MPM prefork to MPM worker.

    So, what's the difference between prefork and worker?

    Quoting from the Apache MPM Prefork page: http://httpd.apache.org/docs/2.0/mod/prefork.html
    MPM Prefork implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3.

    And for the Apache MPM Worker says: http://httpd.apache.org/docs/2.0/mod/worker.html
    MPM Worker implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server.

    Server: Strato (www.strato.de)
    Operating system: SuSE / openSuSE
    Requirements: root access and basic Unix knowledge

    1 Edit the file  
    # vi /etc/sysconfig/apache2

    and change the key:

    APACHE_MPM=" "



    2 You can now tune also  default parameters in file /etc/apache2/server-tuning.conf
    Here are my settings, these are still the default setting of Apache


    # worker MPM

    <IfModule worker.c>
        ServerLimit 16
        # initial number of server processes to start
        StartServers         2
        # minimum number of worker threads which are kept spare
        MinSpareThreads     25
        # maximum number of worker threads which are kept spare
        MaxSpareThreads     75
        # maximum number of simultaneous client connections
        MaxClients       150
        # constant number of worker threads in each server process
        ThreadsPerChild     25
        # maximum number of requests a server process serves
        MaxRequestsPerChild  6000

    3 start
    # apache2-reconfigure-mpm
    this recreate the file  /etc/apache2/sysconfig.d/loadmodule.conf
    and restart apache automatically. Test Your site to ensure everything still work as expected.

  • This module controls the setting of the Expires HTTP header and the max-age directive of the Cache-Control HTTP header in server responses. The expiration date can set to be relative to either the time the source file was last modified, or to the time of the client access.

    These HTTP headers are an instruction to the client about the document's validity and persistence. If cached, the document may be fetched from the cache rather than from the source until this time has passed. After that, the cache copy is considered "expired" and invalid, and a new copy must be obtained from the source.

    How to activate mod_expires.so
    # vi /etc/apache2/conf.d/mod_expires.conf

    config is rough right now, but it is better than nothing,put the following in the file

    LoadModule evasive20_module     /usr/lib/apache2/mod_expires.so
    <IfModule mod_expires.c>
     ExpiresActive On

     ExpiresDefault "access plus 1 month"
     ExpiresByType text/html "access plus 1 month 15 days 2 hours"
     ExpiresByType image/gif "modification plus 1 month"
     ExpiresByType image/png "modification plus 1 month"
     ExpiresByType image/jpg "modification plus 1 month"
     ExpiresByType text/css "access plus 1 month 15 days 2 hours"
     ExpiresByType text/javascript "access plus 1 month 15 days 2 hours"

    You can also set the expire header by type, but it wa snot working in my case, that is why I use the ExpiresDefault directive

  • apache-poi-logo The Apache POI Project's mission is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). In short, you can read and write MS Excel files using Java. In addition, you can read and write MS Word and MS PowerPoint files using Java. Apache POI is your Java Excel solution (for Excel 97-2008). We have a complete API for porting other OOXML and OLE2 formats and welcome others to participate.

    Switch Off logging

    From the documentation at http://poi.apache.org/utils/logging.html

    Logging in POI is used only as a debugging mechanism, not a normal runtime logging system. Logging is ONLY for autopsie type debugging, and should NEVER be enabled on a production system. Enabling logging will reduce performance by at least a factor of 100. If you are not developing POI or trying to debug why POI isn't reading a file correctly, then DO NOT enable logging. You've been warned.

    In order to effectively disable the logging functionality in Apache POI you must use an alternative logger. This is accomplished by providing a property to the POILogFactory to override the default logger. You can add one of these –D to your JVM settings


    I found Apache POI to slightly better perform with the NoOpLog of apache common!

    Recompile poi with more adapted settings

    You can create a custom build of Apache POI 3.8 and alter the following properties to better match the size of the excel files you are generating or reading:

  • org.apache.poi.hssf.usermodel.HSSFRowINITIAL_CAPACITY=5;
  • org.apache.poi.hssf.usermodel.HSSFSheetINITIAL_CAPACITY= 20;&160;&160;&160; // used for compile-time optimization.&160; This is the initial size for the collection of rows.&160; It is currently set to 20.&160; If you generate larger sheets you may benefit by setting this to a higher number and recompiling a custom edition of HSSFSheet.
  • org.apache.poi.hssf.usermodel.HSSFWorkbookINITIAL_CAPACITY=3;&160; // used for compile-time performance/memory optimization.&160; This determines the&160; initial capacity for the sheet collection.&160; Its currently set to 3.Changing it in this release will decrease performance since you're never allowed to have more or less than three sheets!&160;&160;&160;&160;&160;
  • INITIAL_CAPACITY">http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.htmlINITIAL_CAPACITY

    Don’t use xlsx, prefer xls!

    This will only work if you do not reach xls limitations which may avoid you to go to that extreme solution. XLS is not compressed (XLSX is xml based and compressed) and your workbook may double size in memory as a result!

    For example, data beyond 256 (IV) columns by 65,536 rows will not be saved in xls! In Excel 2010 and Excel 2007, the worksheet size is 16,384 columns by 1,048,576 rows, but the worksheet size of Excel 97-2003 is only 256 columns by 65,536 rows. Data in cells outside of this column and row limit is lost in Excel 97-2003. But there is a lot more limitations listed at office.com

    The biggest side effect was that my excel file went from 354kb to 967kb, but the speed increase was quite interesting: more than 44% less evaluation time.

    Small localized optimization

    I don’t think these bring a lot of speed, JIT should optimize this bad piece of code for us but it is always worth trying Speeding up org.apache.poi.hssf.usermodel.HSSFRow.compareTo() and http://affy.blogspot.ch/2004/04/poi-optimization-speeding-_108265938673224937.html

  • Standard Java Hotswap allows only method body change , which makes it practically unusable. (Here you can find some explanations why and how) This article is all about reloading java code without restart :-)

  • apache

    The acronym LAMP refers to a solution stack of software, usually free and open source software, used to run dynamic Web sites or servers. It stand for:

    • Linux, for the operating system;
    • Apache, the Web server;
    • MySQL, the database management system (or database server);
    • Perl, Python, and PHP, the programming languages.

    &160;ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
    Apache-utils package contains utility programs for webservers and some add-on programs useful for any webserver. These include:

    • ab (Apache benchmark tool)
    • Logresolve (Resolve IP addresses to hostname in logfiles)
    • htpasswd (Manipulate basic authentication files)
    • htdigest (Manipulate digest authentication files)
    • dbmmanage (Manipulate basic authentication files in DBM format, using perl)
    • htdbm (Manipulate basic authentication files in DBM format, using APR)
    • rotatelogs (Periodically stop writing to a logfile and open a new one)
    • split-logfile (Split a single log including multiple vhosts)
    • checkgid (Checks whether the caller can setgid to the specified group)
    • check_forensic (Extract mod_log_forensic output from apache log files)

    This package Apache-Utils can be install through apt or YaST depending if you are using a Debian base distro or OpenSuse


    • Define realistic objectives, do not create too much virtual clients if you do not have usually that kind of user traffic..
    • For example an objective could be: number of users served, or percentage of the requests served within a certain time
    • This tool ab do not simulate realistic user behavior, it just hit a page without being able to simulate a complex workflow (like login, navigate and do things users usually do)
    • Try to monitor at the same time the CPU/Memory consumed in order not to make false assumption on apache settings (use top d 1)


    It is an iterative process!

    1. Benchmark,
    2. Change settings and
    3. Restart benchmark.

    It is very important to only change a setting a time in order to better identify what is really bringing something! By changing only one settings at a time, you can:

    • Better see the influence on CPU, memory (you must look also at resources, a server swapping to disk is never good)
    • There is not so much universal settings bringing a speed kick (except DNSlookup off, keep alive small), some settings are depending on your Linux kernel version, CPU class, disk speed, network latency

    Other components

    mysql While tuning apache, you will see that most of the time is used in PHP/MySQL, for MySQL recommend to run at the same time tuning-primer.sh, read more here


    ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [http://]hostname[:port]/path


    -A auth-username:password
    Supply BASIC Authentication credentials to the server. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the server needs it (i.e., has sent an 401 authentication needed).
    -c concurrency
    Number of multiple requests to perform at a time. Default is one request at a time.
    -C cookie-name=value
    Add a Cookie: line to the request. The argument is typically in the form of a name=value pair. This field is repeatable.
    Do not display the "percentage served within XX [ms] table". (legacy support).
    -e csv-file
    Write a Comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests. This is usually more useful than the 'gnuplot' file; as the results are already 'binned'.
    -g gnuplot-file
    Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.
    Display usage information.
    -H custom-header
    Append extra headers to the request. The argument is typically in the form of a valid header line, containing a colon-separated field-value pair (i.e., "Accept-Encoding: zip/zop;8bit").
    Do HEAD requests instead of GET.
    Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
    -n requests
    Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.
    -p POST-file
    File containing data to POST.
    -P proxy-auth-username:password
    Supply BASIC Authentication credentials to a proxy en-route. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the proxy needs it (i.e., has sent an 407 proxy authentication needed).
    When processing more than 150 requests, ab outputs a progress count on stderr every 10% or 100 requests or so. The -q flag will suppress these messages.
    When compiled in (ab -h will show you) use the SSL protected https rather than the http protocol. This feature is experimental and very rudimentary. You probably do not want to use it.
    Do not display the median and standard deviation values, nor display the warning/error messages when the average and median are more than one or two times the standard deviation apart. And default to the min/avg/max values. (legacy support).
    -t timelimit
    Maximum number of seconds to spend for benchmarking. This implies a -n 50000 internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit.
    -T content-type
    Content-type header to use for POST data.
    -v verbosity
    Set verbosity level - 4 and above prints information on headers, 3 and above prints response codes (404, 200, etc.), 2 and above prints warnings and info.
    Display version number and exit.
    Print out results in HTML tables. Default table is two columns wide, with a white background.
    -x <table>-attributes
    String to use as attributes for <table>. Attributes are inserted <table here >.
    -X proxy[:port]
    Use a proxy server for the requests.
    -y <tr>-attributes
    String to use as attributes for <tr>.
    -z <td>-attributes
    String to use as attributes for <td>.

    Some real examples

    time /usr/sbin/ab2 -n 500 -c 30 http://www.waltercedric.com
    This will make 500 requests on them and hammering localhost for 30 seconds

    After tuning Before tuning
    Benchmarking www.waltercedric.comCompleted 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests
    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160; www.waltercedric.com
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80
    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532 bytes
    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 38.576375 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19&160;
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106 bytes
    HTML transferred:&160;&160;&160;&160;&160;&160; 22762106 bytes
    Requests per second:&160;&160;&160; 12.96 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 2314.582 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 77.153 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 582.25 [Kbytes/sec] received
    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160;&160;&160; 8&160; 36.9&160;&160;&160;&160;&160; 0&160;&160;&160;&160; 207
    Processing:&160;&160; 394 2239 345.3&160;&160; 2237&160;&160;&160; 6223
    Waiting:&160;&160;&160;&160;&160; 379 2197 340.9&160;&160; 2190&160;&160;&160; 6173
    Total:&160;&160;&160;&160;&160;&160;&160; 397 2247 344.2&160;&160; 2239&160;&160;&160; 6223
    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 2239
    &160; 66%&160;&160; 2294
    &160; 75%&160;&160; 2327
    &160; 80%&160;&160; 2357
    &160; 90%&160;&160; 2457
    &160; 95%&160;&160; 2560
    &160; 98%&160;&160; 2973
    &160; 99%&160;&160; 3341
    100%&160;&160; 6223 (longest request)
    real&160;&160;&160; 0m38.617s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.240s

    Benchmarking www.waltercedric.com
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests

    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160; www.waltercedric.com
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80

    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532bytes

    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 108.897481 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106bytes
    HTML transferred:&160;&160;&160;&160; 23000106bytes
    Requests per second:&160;&160;&160; 4.59 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 6533.849 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 217.795 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 178.41 [Kbytes/sec] received

    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160; 114 478.9&160;&160;&160;&160;&160; 0&160;&160;&160; 2276
    Processing:&160;&160; 336 6186 1665.2&160;&160; 6108&160;&160; 16189
    Waiting:&160;&160;&160; -5148 5982 1982.8&160;&160; 6066&160;&160; 16009
    Total:&160;&160;&160;&160;&160;&160;&160; 391 6301 1580.2&160;&160; 6120&160;&160; 17093

    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 6120
    &160; 66%&160;&160; 6453
    &160; 75%&160;&160; 6778
    &160; 80%&160;&160; 7046
    &160; 90%&160;&160; 7861
    &160; 95%&160;&160; 8516
    &160; 98%&160; 10110
    &160; 99%&160; 12418
    100%&160; 17093 (longest request)

    real&160;&160;&160; 1m48.905s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.152s


    time /usr/sbin/ab2 -kc 10 -t 30 http://www.waltercedric.com
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds

    Same tests but without mod_security

    • Mod_security is a module for Apache which act like a software firewall
    • Depending on the number of rules, can greatly affect through output speed

    time /usr/sbin/ab2 -kc 10 -t 30 http://www.waltercedric.com
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds

    real&160;&160;&160; 0m39.040s
    user&160;&160;&160; 0m0.020s
    sys&160;&160;&160;&160; 0m0.208s

    Nearly one second more with mod_security gotroot rules, worth the added security!

    If you want to know more options and how to use apache ab check the apache ab/ab2 man page click here for this man page

    How to optimize Apache/Joomla/PHP

    I forward You to some of my previous articles:

    And more ideas here Secure, Safe, Fast Linux Hosting

  • Nginx-logo

    nginx (pronounced “engine-x”) is an open source Web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. It is licensed under a BSD-like license and it runs on Unix, Linux, BSD variants, Mac OS X, Solaris, AIX and Microsoft Windows [WikiPedia]

    These are my reusable settings for any Joomla hosting, these are the most secure, and fastest settings to the best of my knowledge.

    Configuration files are provided using Gist&160; and are CONSTANTLY updated for added security and speed. Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository. I recommend you to starred them to stay up to date.

    Joomla.conf for nginx

    Create a new directory nginx/conf to be able to place reusable nginx settings:

    mkdir -p /etc/nginx/conf

    vi /etc/nginx/conf/joomla.conf

    Edit or create joomla.conf, you can find the latest joomla.conf documented version in one of my Gist at https://gist.github.com/1620307

    Adding a new Joomla Site to nginx

    Create required directory anywhere on your disk, here is an example with a domain www.example.com

    mkdir -p /var/www/vhosts/example.com/httpdocs
    mkdir -p /var/www/vhosts/example.com/logs

    Set the right permission to the user and group you have defined in nginx.conf

    chown -fR www-data:www-data /var/www/vhosts/example.com/httpdocs

    Copy the nginx template and adapt to your liking

    cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example
    vi /etc/nginx/sites-available/example

    Edit or create example, you can find the latest file example documented version in one of my Gist at https://gist.github.com/1620307

    this file include Joomla.conf to avoid duplicating nginx settings

    Activate the new domain

    ln -s /etc/nginx/sites-available/example /etc/nginx/sites-enabled/example
    service nginx restart
  • eclipse_home_header&160; After the huge success and feedback of my first tips on how to speed eclipse, here are more performances tips, some are obvious some not:

    Disabled/Exclude the virus scanner for the eclipse directory: while obvious It will or may be difficult to achieve if you're not administrator on your machine (while not impossible) and that may not make some people happy especially security officers ;-) It is obvious that scanning on the fly every resources in a workspace, is detrimental for speed. You'll get at least 15 to 20% more raw input output speed and gain 5 to 15% CPU cycles.

    Defragment often: NTFS fragment, File get changed, added or remove, so NTFS will fragment very fast, it is time to defragment&160; your disks. And since there is a lot of free program floating around, why not trying to get the last 20% loses in access time and transfer rate? Defragment at least one time a week your Eclipse workspace.

    Get more memory! Windows Server 64bits or Linux 64bits allow you to start with 3GB contiguous memory without complaining, the more memory the better!

    Get a faster disk for your notebook (western Digital black edition / Seagate momentus 1.3 are cheap), or better build yourself a RAID0 array made of 3 disks as you'll get the IO output of 3 disks. Since we do usually more READ access&160; (searching code, browsing hierarchy of objects) than write (writing code, let the compiler run)

    RAID 0 (striped disks) distributes data across several disks in a way that gives improved speed and full capacity, but all data on all disks will be lost if any one disk fails.

    Stop as many thread as possible that are not needed, in this category go all 3rd party nice to have software you may have authorized or not on your notebook: Google desktop search , Windows desktop search, widgets, Rss feeds... the less threads running in the background the better...

    Change for another operating system :-) Linux file systems are blazing fast compare to the venerable NTFS, and threading seems to be a lot better on any 2.6 Linux Kernel.

  • Oui la route tue, c'est un fait mais ne soyons pas hypocrite ou démagogique non plus, mais sachons rester critique. (bien que pas sur un forum, il y a des énervés des 2 cotés de la barrière, j'espère que les propos suivants ne vous choqueront pas, si tel est néanmoins le cas, contacter moiici, je les retirerai)

    • Pour rappel, par années: 2 millions d'enfant meurent de deshydration dans le monde (src Unicef), 60.000 personnes du tabac en france, 60.000 de l'alcool en france (oui mais l'etat a un pourcentage dessus....). 55.000 meurent des conséquences de l'obésité en france (2002). C'est un fait, mourir est de plus en plus facile.
    • Oui l'angletterre a moins d'accidents (3x moins). Mais quel est son parc automobile et la surface de ses routes par CATEGORIES? sans ces informations affirmer cela ne veut plus rien dire. Tout le monde oublie aussi que l'angletterre a rationalisé et aménagé son réseau routier depuis longtemps.
    • Un accident c'est pluri-factoriels, même si la vitesse est un facteur prépondérant, elle ne fait pas tout. Combien de fois on voit sur autoroute des voitures citadines rouler a plus de 160km/h? fiat, twingo et autre pot de yaouth? alors que au niveau du système de freinage, de la sécurité passive et active elles ne sont clairement pas adapté. En tout une porsche à 160 km/h est pas dangeureuse car elle à été construite pour rouler vite.
    • Etre saoul ou légerement alcoolisé et prendre le volant est inaceptable, je suis d'accord sur la tolérance zéro. En effet si on est saoul, c'est comme jouer à la roulette russe avec un barillet presque plein.
    • Ne pas oublier que 8000 morts et 150000 blessés c'est par an, dans ce nombre quelle est la répartition: verglas, "pertes de controle" dues aux problèmes mécanique (rare), collisions multiples, du nombre de personne par véhicule/bus, répartition par mois ou saisons? tous ne sont pas saoul ou inconscients. Cela ne diminue en rien l'horreur mais cela explique bien des choses.
    • Enfin, le mot blessés me choque: c'est un fourre tout qui ne veut rien dire non plus: bras cassés et/ou traumatisme n'ont pas les mêmes conséquences...qu'un bras ou une jambe amputé (votre vie est foutu).
    • Imaginer que le nombre de tués va baisser alors que plus en plus de véhicules sont vendues et roulent est utopique (je dirais même irréaliste). J'aimerai y croire aussi. Comme pour toute activité humaine, il y a des risques, 1500kg ou 2.5t à 60 ou même 90km/h tuera toujours.
    • Une personne meurre toute les 3s dans le monde...y avez vous pensé? non car l'homme est par nature hypocrite. Qui vous dit que notre politique étrngère, vos choix professionnel d'aujourd'hui, l'usine chimique ou vous travaillez ne vas pas causer la mort de quelqu'un demain?.
      Nous sommes tous responsable plus ou moins de la mort de quelqu'un! c'est un fait dans une societé si complexe.
    • Vous je sait pas mais moi je vis en alsace, et beaucoup de route sont passés de 90km/h à 70km/h et maintenant 50km/h, tellement sont à 50km/h que j'ai l'impression d'aller en ville en vélo tellement on se traine. (oui je respecte les limites de vitesse en voiture).
    • Enfin les politiques ou urbanistes de notre ville ont l'intention de rendre la ville au pietons (on retrécit les carrefours, rond point etc...), intention louable (et a la mode) mais qui a comme résultat de me faire prendre plus la moto, et de me faire aller en grande surface, car j'en ai marre le week-end des bouchons, horodateurs à 2â?¬ de l'heure, des PV de staionnement? etc... Ces personnes tuent le centre ville c'est tout.
    • Beaucoup de personne chez moi se prennent des arbres sur une petite route, pourquoi ne pas couper les arbres? personne n'a jamais avoué que la route est tout aussi dangeureuse que les conducteurs! un tracé, une propension a stocker l'eau sur les bas cotés, revetement usés, son manque de visibilité (merci aux buttes avec monuments à la c.., haies de feuillus planté aux carrefours, économies de feux rouges alors qu'a d'autres endroits beaucoup sont inutiles), la proximité d'un étang générateur de brumes, de verglas, de feuilles mortes sur la route...etc
    • Que se passe t'il sur les routes de mulhouse? pourquoi tant de lignes discontinues deviennent tout a coup continues? je ne vois que ces explications:
      • C'est surement un bug informatique de la traceuse, une rémanence du bug de l'an 2000 ou alors
      • L'etat soudainement n'aime plus les trous ailleurs que dans ses caisses publiques ou alors
      • Les stocks de peinture blanche sont trop important: "c'est pour pas gacher" c Guy Roux ou alors
      • Les fabriquants de peinture blanche font des lots promotionnels...

      C'est sur a 50km/h (voire 30km/h !!!!) et sans le droit de doubler même sur des superbe lignes droite à la visibilité parfaite (sur des km et des km) les accidents vont baisser.....Noter que quand je roule sur un de mes vieux scooter (manurhin 45km/h en pointe sur du plat) TOUS les automobilistes franchissent les lignes continues alors qu moi même en moto je ne le fait pas (eh oui)

    • Les radars sont sur les routes les plus accidentogène: poudre aux yeux de la communication, ils sont toujours dans mon agglomeration au meme endroit: ligne droite, devenues continues (sic), 90 puis 70 puis 50km/h et ou le dernier accident mortel remonte a plus de 20 ans.
    • Dernier exemple qui montre que la justice est aveugle mais que cela sert d'avoir des copains: un député prit a plus de 100km/h au lieu de 50km/h condamner à un retrait de permis de une semaine (si quelqu'un retrouve son nom je serai heureux de le signaler ici, la presse en a assez parlé...). Vous penserez a cela lorsqu'on vous interdira de permis pour 3 ans devant un tribunal...
    • Depuis le début de l'année les conditions météo ont été exceptionnelle (pas de pluie) donc forcèment les chiffres sont plus bas que l'année dernière, et cela c'est un fait, pas besoin de la méthode Sarkozi, attendons l'hiver pour voir les vrais chiffres, même si je suis persuadé que on ne connaitras jamais les vrais chiffres.
    • Les gens roulent moins vite par peur des gendarmes, avec un effet pervers inatendu: on ne meurrent plus mais on crée des tétraplégiques et des légumes. En effet se prendre un arbre à 100km/h ou à 50km/h ne fait pas gagner grand chose.

    En conclusions:

    • Les chiffres, on peut leur faire dire ce que l'on veut: un exemple? 25 milions de véhicules roulent par an en france, 158000 victimes =>0,6% d'accidents sur le parc par an... oui c'est con comme calcul, mais ont peut le faire et dans ce cas on pourrait dire: "très peu d'acccident en france", cela resterait sérieux.

    Mes prédictions:

    • Résultat positif pour le marché de l'occasion, les missiles sol-sol (ducati 996, cbr 900r, hayabusa, ninja etc..) vont fleurir en occasion (car leur conducteur seront soit en prison ou sans permis).
    • Les ventes neuves de moto/auto puissantes vont s'écrouler. (ou alors trouveront preneur chez les ministres). La consommation d'essences va baisser car on roulera moins vite (ce qui n'est pas une mauvaise chose en soi de moins consommer du pétrole),
    • Le commerce va en patir, moins d'alccol, moins d'ambiance dans les boites de nuits (moi je m'en fous, je n'ai jamais bu d'alcool de ma vie)
    • Les constructeurs vont devoir ravaler leurs moteurs puissants et livrer des voitures aux moteurs aseptisés.

    Mes solutions:

    • Limiter tout les moteurs à 35CV et en électrique (ziiiiiiii ou lieu de vroum vroum beurk), vous je sais pas mais moi je change de pays le lendemain ou cette loi passe...
    • interroger les services d'urgences et demander leur ou ils ramassent le plus de blessés ou de morts, ensuite interroger vous sur les causes et trouver des solutions.
    • Assureur à quand des prix raisonnables sur des assurances type circuit privé ou on pourrait enfin s'amuser en sécurité?
    • L'état francais et les départements devrait ouvrir les circuits de compétition le week-end et proposer des formules d'abonnements à la carte.
    • Allèger les voitures, énergie cinétique moindre en cas de choc. Tant que les loi d'inertie régirons les mouvements des mobiles, il y aura très peut de paramètres sur lesquelles agir.
  • css.sprite.generator

    Here is an useful tool for improving performance of your website: The CSS sprite generator takes a number of source images and combines them into a single "sprite" image and supplies CSS to map to each image within the sprite. The technique this tool employs is often used to improve the performance of a web site by reducing the number of HTTP requests that the client's browser needs to make.

    CSS sprites are a way to reduce the number of HTTP requests made for image resources referenced by your site. Images are combined into one larger image at defined X and Y coordinates. Having assigned this generated image to relevant page elements the background-position CSS property can then be used to shift the visible area to the required component image.

    This technique can be very effective for improving site performance, particularly in situations where many small images, such as menu icons, are used. The Yahoo! home page, for example, employs the technique for exactly this.

    I’ve installed a copy of this tool at:


    And took time to:

    1. Improve the overall internal security of the tools, by using some technique of Joomla! framework, so most type of attacks (XSS, parameter tampering, path browsing, avoid direct execution of files) should be eliminated,
    2. The tool now extract the ZIP file without being forced to use the dangerous shell_exec php command (I switch it off on my host anyway), the tool support&160; if they are available in that order: ZipArchive(), zip_open() and shell_exec()
    3. Make the code a bit more portable (avoiding .. inclusion for files, use DIRECTORY_SEPARATOR)

    And I did audit the code using Acunetix Web security Scanner, the result can be seen below:


    The source code for CSS Sprite Generator is available for download and is covered by a BSD license. Want to run a local copy, get the source code at https://launchpad.net/css-sprite-generator

    My version will be available soon, link to appear later this week.

    Note about PHP and Zip support

    To install zip PECL package run the following as root:

    # pear installhttp://pecl.php.net/get/zip

    and create a new file at

    # vi /etc/php5/conf.d/zip.ini

    with following content


    Restart apache

  • At SD Forum 2006, Randy Shoup and Dan Pritchett, both with eBay, gave a presentation on eBay's architecture. Pritchett subsequently posted his presentation slides in his blog, The eBay Architecture.
    Predictably, the presentation contained a few inspiring statistics, such as:
    • 15,000 application instances running in eight data centers
    • 212,000,000 registered users
    • 1 billion page views per day
    • 26 billion SQL queries and updates per day
    • Over 2 petabytes of data
    • $1,590 worth of goods traded per second
    • Over 1 billion photos
    • 7 languages
    • 99.94% uptime

    Other stats in the presentation related to development process and features, such as:

  • Over 300 new features released each quarter
  • Over 100,000 lines of code released every two weeks

"According to the presentation, the goal of eBay's current architecture is to handle an additional ten-fold increase in traffic, something eBay expects to reach within a few short years. Another architecture objective is to be able to handle peak loads, and for components to gracefully degrade under unusual load or in the case of system failures." read more  HERE


  • Petit rappel...
    < Ã 20 km/h
    • 68 euro d'amende (45 euro si réglé dans les 15 jours)
    • Retrait d'1 point
    20km/h > vitesse < 30 km/h
    • 135 euro d'amende (90 euro si réglé dans les 15 jours)
    • Retrait de 2 points
    30km/h > vitesse < 40 km/h
    • 135 euro d'amende (90 euro si réglé dans les 15 jours)
    • Suspension du permis jusqu'Ã 3 ans, 
    • Retrait de 3 points.
    40km/h > vitesse < 50 km/h
    • 135 euro d'amende (90 euro si réglé dans les 15 jours),
    • Suspension du permis jusqu'Ã 3 ans,
    • Retrait de 4 points,
    • rétention immédiate du permis.
    > 50 km/h
    • Jusqu'Ã 1500 euro d'amende,
    • Suspension du permis jusqu'a 3 ans,
    • Retrait de 6 points,
    • Rétention immédiate du permis

     petit rappel aussi, il y a 170 000 morts/ans par accident cardiovasculaires en france...

  • If you want to know a bit more on the infrastructure that is used by Google...

  • nginx (pronounced “engine-x”) is an open source Web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. It is licensed under a BSD-like license and it runs on Unix, Linux, BSD variants, Mac OS X, Solaris, AIX and Microsoft Windows [WikiPedia]

    Instructs proxy servers to cache two versions of the resource: one compressed, and one uncompressed. This helps avoid issues with public proxies that do not detect the presence of a Content-Encoding header properly.

    Configuration files are provided using Gist  https://gist.github.com/1620307 and are CONSTANTLY updated for added security and speed. Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository. I recommend you to starred them to stay up to date.


    Just Add in /etc/nginx/nginx.conf in the http { … } section the following

     # Gzip Settings
     gzip  on;
     gzip_http_version 1.1;
     gzip_vary on;
     gzip_comp_level 6;
     gzip_proxied any;
     gzip_types text/plain text/html text/css application/json \
    application/x-javascript text/xml application/xml \
    application/xml+rss text/javascript application/javascript \
    text/x-js; gzip_buffers 16 8k; gzip_disable "MSIE [1-6]\.(?!.*SV1)";


    from LeverageProxyCaching">https://developers.google.com/speed/docs/best-practices/cachingLeverageProxyCaching

  • I really like this small Firefox extension Smushit as it allow to quickly check if all my images are optimized for the best size and thus speed of rendering. But wait IE/Opera/Chrome can still use this bookmarlet :-) to optimize the images found on any web page!

    From http://www.smushit.com/

    Image optimization is an art that not many people master. There are many good image editing tools that allow us to get the best visual result for a certain file size but "under the hood" a lot more optimization can be done.

    Smushit.com is a service that goes beyond the limitations of Photoshop, Fireworks & Co. It uses image format specific non-lossy image optimization tools to squeeze the last bytes out of your images - without changing their look or visual quality. You'll get a report of how many bytes you can save by optimizing your images and all the changed images as a single zip for download.

    Saving bytes has never been so easy - you point us in the right direction, and we'll do the rest for you. A ZIP archive with optimized images will be generated for you.

  • mobile.waltercedric.com

    I’ve created an optimized site for mobile, it is pretty basic but is lightning fast on any smart phone (Android, iPhone, Windows Mobile). I will invest more time on it later this week.

    It detect and redirect visitors to an optimized template (pda) which only display what is worth, aka articles content.

    Regular user can see how it look like by cheating Joomla! and switching template on the fly http://www.waltercedric.com/index.php?template=pda

    I did not follow this tutorial, found it too late,&160; but it is really complete and easy to follow. By the way, opera has a “small screen rendering” view in Opera 10, visit my site or any other and click SHIFT-F11 together.

    The plugin with its template can be downloaded free of charge at Joomla! extension directory (JED) here


    I did test it in IE8/IE7/Opera10/Firefox/Chrome, but send me an email if you encounter any issues..

  • Data URI scheme is a URI scheme that provides a way to include data in line in web pages as if they were external resources. [WikiPedia]

    Why you may want to start embedding images in CSS ?

    • It reduce the number of http requests: instead of 1+N HTTP requests (1 for aggregated CSS file and N for images) you'll get 1+1 requests (1 for aggregated CSS file and one for CSS file with all images), which gives you faster page loading and lower server load.
    • CSS is cached by browsers and these images can be reused with a CSS selector/class (<li> are obvious candidate if they use images)
    • Attention Internet Explorer 5 to Internet Explorer 7 do not support inline images!

    NOTA: Drupal has a module “CSS Embedded Images” to automatize the inclusion of external images in CSS, while Joomla has nothing Sad smile something that could be done in Joomla platform, in an extension like JFinalizer….or in the Gantry framework!

    I did start looking at the code of “CSS Embedded Images” and I am trying to make it a class for Joomla 2.5


    • Google Chrome
    • Firefox 2+ / Gecko
    • Opera 7.2+
    • Safari
    • Konqueror and derivatives

    You can create data URL with

    <?php echo base64_encode(file_get_contents("http://www.acme.com/images/myimage.png")) ?>

    or by using one of the many online generator

    (X)HTML Image Embedding example
    <img alt="Embedded Image" 
      src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />
    CSS Image Embedding Example
    div.image {
    XML Image Embedding Example
      <title>An Image</title>
  • apache_maven

    The obvious things to do first in no particular order

    • Use a better build server, CPU power is cheap today,
    • Throw more memory, as Maven run in a JVM the more you have the better it may behave, you may want also to increased the perm gen space,
    • Use the latest  version of JVM!
    • Switch as many plugins as possible as long as there are not needed in the main build loop: Use profile to modularize your build and trigger some additional build/reporting plugins when needed. You want your build to be fast to provide fast feedback to your developers.
    • Optimize your test cases, some may take longer than other, use @BeforeClass or Lazy initialization to cache some heavy to create objects,
    • Tune the garbage collector according to your build behavior, number of CPU core:  use parallel garbage collector for example,
    • Carefully review your dependencies as the less Apache Maven has to load while building the faster it will get.
      • Are they all needed?
      • No duplicates dependencies?
      • Do you miss some <exclusions>? are all these transitive dependencies to your 3rd party needed?
      • No dependencies cycles? check the order in reactor. A developer should understand, and not be surprised by  the order of the modules calculated by Maven (as long as you have layers in your software, you expect some modules to be build before some others) .
    • Review ALL logs files
      • The one created by Maven to avoid any warnings and
      • All your application logs (do you log too much data during the build?)
  • The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. It was conceived of to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. from http://nl2.php.net/apc

    Unpack your distribution file. You will have downloaded a file named something like apc_x.y.tar.gz. Unzip this file with a command like
    # wget http://pecl.php.net/get/APC-3.0.14.tgz
    # gunzip apc_x.y.tar.gz

    Next you have to untar it with
    #  tar xvf apc_x.y.tar

    This will create an apc_x.y directory. cd into this new directory:
    # cd apc_x.y

    phpize is a script that should have been installed with PHP, and is normally located in /usr/local/php/binassuming you installed PHP in /usr/local/php. (If you do not have the phpize script, you must reinstall PHP and be sure not to disable PEAR.).

    Locate phpize:
    # find / -name phpize

    mine is in
    yours may be in /usr/local/php/bin/phpize

    Run the phpize command:
    #  /usr/local/php/bin/phpize

    Its output should resemble this:
            Configuring for:
              PHP Api Version:   20020918
              Zend Module Api No:   20020429
              Zend Extension Api No:   20021010

    phpize should create a configure script in the current directory. If you get errors instead, you might be missing some required development tools, such as autoconf or libtool. You can try downloading the latest versions of those tools and running phpize again.

    Run the configure script.

    phpize creates a configure script. The only option you need to specify is the location of your php-config script.

    find location of php-config
    # find / -name php-config
    # ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/etc/alternatives/php-config

    php-config should be located in the same directory as phpize.
    If you prefer to use mmap instead of the default IPC shared memory support,  add --enable-apc-mmap to your configure line.

        If you prefer to use sysv IPC semaphores over the safer fcntl() locks, add --enable-sem to your configure line.  If you don't have a problem
        with your server segaulting, or any other unnatural accumulation of semaphores on your system, the semaphore based locking is slightly faster.

    Compile and install the files.
    Simply type:
    # make install
    Installing shared extensions:     /usr/lib/php5/extensions/

    Suggested Configuration (in your php.ini file)


    Although the default APC settings are fine for many installations, serious
    users should consider tuning the following parameters:

        OPTION                  DESCRIPTION
        ------------------      --------------------------------------------------
        apc.enabled             This can be set to 0 to disable APC. This is
                                primarily useful when APC is statically compiled
                                into PHP, since there is no other way to disable
                                it (when compiled as a DSO, the zend_extension
                                line can just be commented-out).
                                (Default: 1)

        apc.shm_segments        The number of shared memory segments to allocate
                                for the compiler cache. If APC is running out of
                                shared memory but you have already set
                                apc.shm_size as high as your system allows, you
                                can try raising this value.  Setting this to a
                                value other than 1 has no effect in mmap mode
                                since mmap'ed shm segments don't have size limits.
                                (Default: 1)

        apc.shm_size            The size of each shared memory segment in MB.
                                By default, some systems (including most BSD
                                variants) have very low limits on the size of a
                                shared memory segment.
                                (Default: 30)

        apc.optimization        This option has been deprecated.
                                (Default: 0)

        apc.num_files_hint      A "hint" about the number of distinct source files
                                that will be included or requested on your web
                                server. Set to zero or omit if you're not sure;
                                this setting is mainly useful for sites that have
                                many thousands of source files.
                                (Default: 1000)

        apc.user_entries_hint   Just like num_files_hint, a "hint" about the number
                                of distinct user cache variables to store.
                                Set to zero or omit if you're not sure;
                                (Default: 4096)

        apc.ttl                 The number of seconds a cache entry is allowed to
                                idle in a slot in case this cache entry slot is
                                needed by another entry.  Leaving this at zero
                                means that your cache could potentially fill up
                                with stale entries while newer entries won't be
                                (Default: 0)

        apc.user_ttl            The number of seconds a user cache entry is allowed
                                to idle in a slot in case this cache entry slot is
                                needed by another entry.  Leaving this at zero
                                means that your cache could potentially fill up
                                with stale entries while newer entries won't be
                                (Default: 0)

        apc.gc_ttl              The number of seconds that a cache entry may
                                remain on the garbage-collection list. This value
                                provides a failsafe in the event that a server
                                process dies while executing a cached source file;
                                if that source file is modified, the memory
                                allocated for the old version will not be
                                reclaimed until this TTL reached. Set to zero to
                                disable this feature.
                                (Default: 3600)

     apc.cache_by_default    On by default, but can be set to off and used in
                                conjunction with positive apc.filters so that files
                                are only cached if matched by a positive filter.
                                (Default: On)

        apc.filters             A comma-separated list of POSIX extended regular
                                expressions. If any pattern matches the source
                                filename, the file will not be cached. Note that
                                the filename used for matching is the one passed
                                to include/require, not the absolute path.  If the
                                first character of the expression is a + then the
                                expression will be additive in the sense that any
                                files matched by the expression will be cached, and
                                if the first character is a - then anything matched
                                will not be cached.  The - case is the default, so
                                it can be left off.
                                (Default: "")

        apc.mmap_file_mask      If compiled with MMAP support by using --enable-mmap
                                this is the mktemp-style file_mask to pass to the
                                mmap module for determing whether your mmap'ed memory
                                region is going to be file-backed or shared memory
                                backed.  For straight file-backed mmap, set it to
                                something like /tmp/apc.XXXXXX (exactly 6 X's).
                                To use POSIX-style shm_open/mmap put a ".shm"
                                somewhere in your mask.  eg.  "/apc.shm.XXXXXX"
                                You can also set it to "/dev/zero" to use your
                                kernel's /dev/zero interface to anonymous mmap'ed
                                memory.  Leaving it undefined will force an
                                anonymous mmap.
                                (Default: "")

        apc.slam_defense        ** DEPRECATED - Use apc.write_lock instead **
                                On very busy servers whenever you start the server or
                                modify files you can create a race of many processes
                                all trying to cache the same file at the same time.
                                This option sets the percentage of processes that will
                                skip trying to cache an uncached file.  Or think of it
                                as the probability of a single process to skip caching.
                                For example, setting this to 75 would mean that there is
                                a 75% chance that the process will not cache an uncached
                                file.  So the higher the setting the greater the defense
                                against cache slams.  Setting this to 0 disables this
                                (Default: 0)

                                When you modify a file on a live web server you really
                                should do so in an atomic manner.  That is, write to a
                                temporary file and rename (mv) the file into its permanent
                                position when it is ready.  Many text editors, cp, tar and
                                other such programs don't do this.  This means that there
                                is a chance that a file is accessed (and cached) while it
                                is still being written to.  This file_update_protection
                                setting puts a delay on caching brand new files.  The
                                default is 2 seconds which means that if the modification
                                timestamp (mtime) on a file shows that it is less than 2
                                seconds old when it is accessed, it will not be cached.
                                The unfortunate person who accessed this half-written file
                                will still see weirdness, but at least it won't persist.
                                If you are certain you always atomically update your files
                                by using something like rsync which does this correctly, you
                                can turn this protection off by setting it to 0.  If you
                                have a system that is flooded with io causing some update
                                procedure to take longer than 2 seconds, you may want to
                                increase this a bit.
                                (Default: 2)

        apc.enable_cli          Mostly for testing and debugging.  Setting this enables APC
                                for the CLI version of PHP.  Normally you wouldn't want to
                                create, populate and tear down the APC cache on every CLI
                                request, but for various test scenarios it is handy to be
                                able to enable APC for the CLI version of APC easily.
                                (Default: 0)

        apc.max_file_size       Prevents large files from being cached.
                                (Default: 1M)

        apc.stat                Whether to stat the main script file and the fullpath
                                includes.  If you turn this off you will need to restart

     apc.write_lock          On busy servers when you first start up the server, or when
                                many files are modified, you can end up with all your processes
                                trying to compile and cache the same files.  With write_lock
                                enabled, only one process at a time will try to compile an
                                uncached script while the other processes will run uncached
                                instead of sitting around waiting on a lock.
                                (Default: 1)

        apc.report_autofilter   Logs any scripts that were automatically excluded from being
                                cached due to early/late binding issues.
                                (Default: 0)

        apc.rfc1867             RFC1867 File Upload Progress hook handler is only available
                                if you compiled APC against PHP 5.2.0 or later.  When enabled
                                any file uploads which includes a field called
                                APC_UPLOAD_PROGRESS before the file field in an upload form
                                will cause APC to automatically create an upload_<key>
                                user cache entry where <key> is the value of the
                                APC_UPLOAD_PROGRESS form entry.

                                Note that the file upload tracking is not threadsafe at this
                                point, so new uploads that happen while a previous one is
                                still going will disable the tracking for the previous.
                                (Default: 0)

        apc.localcache          This enables a lock-free local process shadow-cache which
                                reduces lock contention when the cache is being written to.
                                (Default: 0)

        apc.localcache.size     The size of the local process shadow-cache, should be set to
                                a sufficently large value, approximately half of num_files_hint.
                                (Default: 512)

                                Optimize include_once and require_once calls and avoid the
                                expensive system calls used.
                                (Default: 0)