We’re having an issue with our new LTM 6400 box. With the following iRule enabled for logging, the syslog-ng & alertd processes are taking up almost 100% of one CPU during a performance testing. The second CPU which I think is dedicated to TMM is not doing much but we’re not sure what can be done to reduce the CPU 00 usage without disabling logging. Is this something to do with the way the irules was written ?
when HTTP_REQUEST {
set client_ip [IP::client_addr]
set http_request [HTTP::request]
set http_request_time [clock clicks -milliseconds]
I’m curious to see Mike’s response, but in the meantime…
I think it’s expected that alertd and syslog-ng will eat up CPU cycles when you’re trying to log a lot of events. In general, I disable all but essential logging when putting a rule in production. You can either use a debug flag to only log when you need it, or, more efficiently, comment out the log statements.
How many requests per second are being passed through the VIP with this rule? If you do want to log the request details, you could make the rule slightly more efficient by eliminating the intermediate variables:
[code]
when HTTP_REQUEST {
set http_request_time [clock clicks -milliseconds]
You could also remove the calculation of the delta and calculate that after the fact from the logs. Also, the HTTP::request could be very large. If you don’t really need the full request logged, you could remove it.
I share hoolio’s sentiment about only logging when you need it, and reducing what you log. For example, based on the calculation you’re doing I’ll bet you’re wanting to track server responses that take too long. I’d consider changing the logic such that you *only* log requests that are past a certain threshold. i.e. if it takes longer than 5000ms, log it, otherwise do nothing.
Logging at a high rate of speed requires either that you have fast disks, or that we be able to send log messages to a remote host that does. Since BIG-IP doesn’t have fast disks, I suggest:
a) Reduce how often you’re logging
b) Reduce how much you’re logging
c) Send the log messages elsewhere, directly with the log command
Thanks guys, I actually contacted F5 support and managed to reduce the CPU usage significantly by doing the following:
1) reduced the length of the log entry by only logging the HTTP response and not the entire HTTP request
2) Since we also use a modified version of syslog-ng.conf to log things into different files, we’ve now remove all the regular expression from all the custom filters that we’ve created.
3) By modifying the syslog-ng.conf again, I was able to filter out all of our log messages from the alertd process which by default examine all message logged.
After the above 3 steps, the CPU 0 usage dropped from 100% to below 3% during load testing.