Haproxy Error 502 Bad Gateway

Jika anda menggunakan haproxy kemudian mendapati error 502 Bad Gateway bisa jadi itu disebabkan buffer size pada haproxy telah mencapai limit pada nilai default 16384 tapi untuk memastikan coba naikan menjadi

Tambahkan di setting global

tune.bufsize 25000

kemudian restart haproxy

tune.bufsize <number>
Sets the buffer size to this size (in bytes). Lower values allow more sessions to coexist in the same amount of RAM, and higher values allow some applications with very large cookies to work. The default value is 16384 and can be changed at build time. It is strongly recommended not to change this from the default value, as very low values will break some services such as statistics, and values larger than default size will increase memory usage, possibly causing the system to run out of memory. At least the global maxconn parameter should be decreased by the same factor as this one is increased. If HTTP request is larger than (tune.bufsize – tune.maxrewrite), haproxy will return HTTP 400 (Bad Request) error. Similarly if an HTTP response is larger than this size, haproxy will return HTTP 502 (Bad Gateway).”

sumber http://haproxy.tech-notes.net/3-2-performance-tuning/

Leave a Reply

Your email address will not be published. Required fields are marked *