Archive for November 2010
Configuring Windows for high network connection rates
When a TCP/IP socket is closed, it goes into TIME_WAIT state before closing, for a period of time determined by the operating system. A socket in TIME_WAIT state cannot be reused; this can limit the maximum rate at which network connections can be created and disconnected.
The client application normally closes the socket; if the application is on a different machine, the limitation usually applies to the machine running the application. The symptoms of a machine that is reaching these limits include:
All of the TCP/IP resources of the operating system are in use, and requests for new connections fail. Running the netstat -a command on the application machine shows a large number of sockets in TIME_WAIT state.
Performance deteriorates.
To improve the ability of the Windows operating system to deal with a high rate of network connections, add the following registry entries in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters
TcpTimedWaitDelay
A DWORD value, in the range 30-300, that determines the time in seconds that elapses before TCP can release a closed connection and reuse its resources. Set this to a low value to reduce the amount of time that sockets stay in TIME_WAIT.
MaxUserPort
A DWORD value that determines the highest port number that TCP can assign when an application requests an available user port. Set this to a high value to increase the total number of sockets that can be connected to the port.
For example, a system making a large number of connection requests might perform better if TcpTimedWaitDelay is set to 30 seconds, and MaxUserPort is set to 32678
Replay traffic with httperf
If you need to replay your live traffic on a web server, here’s how to do it using httperf:
First you need to prepare your webserver log file, which means removing all unwanted stuff like javascript, images, css etc.
Then extract the URLs from log file with e.g. awk:
awk '{print $7}' access.log > requests.log
Translate into httperf format (requests must be separated by ASCII NUL):
tr "\n" "\0" < requests.log > httperf_wlog
Finally, feed it into httperf:
httperf --server 1.2.3.4 --wlog=B,httperf_wlog
If parameter B is set to ‘‘y’’, httperf will wrap around to the beginning of the file when reaching the end of the list (so the list of URIs is accessed repeatedly). With B set to ‘‘n’’, the test will stop no later than when reaching the end of the URI list.
Taking screenshots and recording screencasts on Android phone
No need to root your phone.
Setting up your phone
Download and install Android SDK on your PC.
Connect your phone in USB debugging mode and make sure your phone is detected properly by
sdk/tools/adb devices
Taking screenshots
Run
sdk/tools/dbms
Once it starts, select your phone and press CTRL+S or goto menu Device > Screen Capture
Recording screencasts
Make sure you have Java Runtime Environnement 5 or later installed
Run androidscreencast from google code project