Hi, On Sun, Dec 30, 2012 at 06:42:58PM +0000, Alon Muchnick wrote: > hi , > we have haproxy installed locally on a cluster of servers(centos 5.5 ) > behind a layer 4 load balancer,all with the same > configuration file and log setting. > > on some servers there is a mismatch between the number of > session seen in the stats uri and the amount of records in the log file , > on others the number correlate. > > for example on a problematic sever : > > (log has been truncated and stats were rested at the same time) > > total number of sessions from stats uri : 2111156 > number of records in log file : 112834 > > > each second the log is increases by about 50 records > while on a different server with the same load > each second the log is increases by about 1000 records. > > on a correctly working sever : > total number of sessions from stats uri : 2483449 > number of records in log file : 2482151 > > each second the log is increases by about 1000 records > the same as the session change rate. > > > can some one might point to the cause of the problem? > since the haproxy config is the same on all servers , > i guess the difference is somewhere in the OS level . > > below are our log config : > > from haproxy config file > > global > log 127.0.0.1 local0 > .... > > defaults > mode http > log global > option httplog > ..... > > from/etc/syslog.conf: > .. > *.info;mail.none;authpriv.none;cron.none;local0.none /var/log/messages > ... > #save haproxy log > local0.* /var/log/haproxy.log
Your syslog server is logging synchronously by default, and very likely it cannot sync the disk as fast as every log comes in so it's forced to drop a lot of them. Please prefix the file name with a "-" above to enable async logging : local0.* -/var/log/haproxy.log It should fix the problem. Very likely your second server has less disk activity and is able to cope with the load. Regards, Willy

