Hi Willy,
On Sat, May 12, 2012 at 7:08 PM, Willy Tarreau <[email protected]> wrote: > On Sat, May 12, 2012 at 06:54:06PM +0300, Bar Ziony wrote: > > I have no problem increasing the RAM if needed, but how do I know if it's > > needed? Where can I see the number of connections per second to see if I > > somehow reached 20k ? > > I have not said 20k conns/s, but 20k concurrent conns. Concurrency is the > conns rate times the response time. If the site slows down, concurrency > increases. > I'm sorry but I didn't quite get what does Concurrency means. Connection/sec * response time ? Why is that = concurrency? > > > I don't think I reached 20k because the global maxconn is 20K.... > > OK so most likely you need some tuning on the system. > > > This is my TCP tuning config for the LB: > > # TCP stack tuning > (...) > nothing wrong here, but please check : > tcp_mem > tcp_rmem > tcp_wmem > Here they are: net.ipv4.tcp_mem = 24372 32496 48744 net.ipv4.tcp_wmem = 4096 16384 1039872 net.ipv4.tcp_rmem = 4096 87380 1039872 Are those valid? > > > This is my haproxy.cfg: > > global > > daemon > > user haproxy > > group proxy > > log 127.0.0.1 local0 > > log-send-hostname > > maxconn 20000 > > You can reduce haproxy's memory usage by reducing buffer sizes this > way here : > tune.bufsize 8030 > tune.maxrewrite 1030 > But would this hurt somehow? I can increase the RAM if that will solve the problem! I just wonder how it is possible that haproxy is using so much RAM, when I didn't see so much RAM usage from my old single web server (nginx). I don't want to configure stuff for a low-RAM machine if I actually need more RAM. We have no problem paying for a bigger VPS (but unfortunately we must stay on this VPS infrastructure). > > Any help would be much appreciated, we're experiencing issues with less > > traffic than before haproxy... > > Which is quite the opposite of the seeked goal I can imagine ! > > You should really check what consumes memory on your system. I once hit an > issue on a machine which was centralizing logs each night, but the problem > is that these logs were completely buffered before being transferred, > causing > the system to swap. > Only nginx is running on this machine as well to terminate SSL, but it seems like haproxy is the one that consumes all memory. Nothing else is running on the machines besides syslog for haproxy and the machine itself, regular processes and munin plugins every 5 minutes (which are not causing any RAM issues)... > > Ideally you should disable swap. Any component which swaps in web > environments > is going to definitely kill all the performance and make things worse. > Better > have the component die and switchover to the redundant one than having it > swap > and stay alive! > Very good idea, especially for our LBs. I will do that. > > BTW, I'm just thinking at one point since you're virtualized : are you > *certain* that you have the 1GB memory dedicated to you and that you've > not enabled any form of ballooning ? Ballooning is a clever technique some > hypervisors use to allow vendors to sell the memory multiple times to their > customers, because the principle is that the hypervisor allocates the RAM > from the VMs when it needs some! It easily allows a 64G machine to be split > into 256*1G VMs by stealing the unused memory from the VMs. But when these > VMs try to use their memory, they can only swap :-) > Yes, I'm certain that our VPs provider is not doing this. We have the entire 1GB for ourselves. > > Cheers, > Willy > > I just wonder what would be the best approach? Should I try the 2GB RAM machine? Thanks! Bar.

