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 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

> 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

> 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.

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!

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 :-)

Cheers,
Willy


Reply via email to