September 3, 2011

Padhye et. al. Equation and TCP performance

If you are not familiar with the Mathis Equation, I recommend you quickly go over my post article Mathis Equation and TCP Performance. This is necessary since the Padhye et. al. Equation is an extension to the Mathis Equation for accuracy of TCP throughput calculation over multiple scenario of packet loss. As simply put, the Padhye et. al. Equation Equation is exactly the same concept as the Mathis Equation but taking in consideration the Maximum TCP Window size affected by received/lost/duplicate ACK, the initial retransmit timer and the effect of the TCP timeout mechanism on the total throughput. ... Read more

October 21, 2009

PHP OPCodes Cached with APC - part 1

There are many caching system in use to optimize the execution of PHP script on busy web/database servers. Today we will focus on the OPcode caching method using APC. Before we start… what is an OPcode? The OPcode is an executable code generated each time a PHP script is interpreted and compiled. Each time you visit a webpage, the webserver (apache for example) would generate an OPcode of the PHP script serving your request. They are therefore simply C data structure which are interpreted by the PHP Virtual Machine (Zend Engine). Now you can imagine, generating the OPcode can be a drain on the server and quite useless if the code does not change often. This is where the OPcode caching system comes into play; but before we go on, let’s see some OPcode example using the Vulcan Logic Disassembler. First, we create a file test.php in which we will execute a unix ls -l command test.php - <? system(“ls -l”); ?> wrk01:/var/www# php -d test.php Branch analysis from position: 0 Return found filename: /var/www/test.php function name: (null) number of ops: 4 compiled vars: none line # op fetch ext return operands 2 0 SEND_VAL ‘ls+-l’ 1 DO_FCALL 1 ‘system’ 4 2 RETURN 1 3* ZEND_HANDLE_EXCEPTION Now let’s try a simple ( echo “hello world!” ) ... Read more