Skip to main content

Posts

Showing posts from February, 2013

Stupidity

A requirement came to me that we need to enable timeout in php-curl with timeout values being in millisecond. We cant even wait for a second to curl to terminate. Php uses native curl in unix systems. The curl supports this feature in version>7.19. For our OS the curl version is 7.15. Ofcourse we can install 7.19 using rpm or source But php had a wrapper module curl.so, so all php-curl method call will go to curl.so which inturn will call native curl. So curl.so is not aware of the timeout_ms in feature and started throwing php errors.  A hack would be to replace curl.so with the one which supports timeout_ms from other version of OS.  But nobody is interested in this change because if something crashes in production, it would be huge effort and loss.  I downloaded the Source RPMS(RPM are binary and Source RPMS will have the source code and SPEC file). The SPEC file will take care of configure, make and install part (which we have to do manually if we install from sourc

Idle Cpu

We are facing a issue for the past one month and I am still unsure of the reason. Will rollout a change next monday on all our webservers to see how my reasoning works. Situation: We have a dozen webservers behind a Load Balancer in one of our setups. Each webserver receives some 300  req/sec i.e our setup receives around 5000 req/sec. Each web server will have 1024 apache process waiting for connections. At any moment 600 apache process will be free. But at the start of every hour the number of free process dips and reaches even to zero. When number of idle process reaches zero, response time, memory used and contentions for resource will increase drastically and thereby hitting the performance. Possible Reasons: It is proved that this situation is reproduced whenever logrotate is run. Logrotate is scheduled to run at the start of every hour. LogRotate: We log each apache access and error details in a file, which comes in handy when the system is being attacked by some ano