Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've a setup with haproxy as frontend to two varnish servers (say srvA, srvB). srvA and srvB also have nginx running on 'em and varnish serves as frontend to these servers. Few days back we collected stats to find out how many requests being served by varnish cache (i.e. with two X-Varnish values) were getting timed out on haproxy. Interestingly we found that almost 30% of the response from varnish were getting timedout.

Following is a snippet of json log:

{"http":{"domain":"blah_blah_blah","request_method":"GET","request_protocol_version":"1.1","browser":"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.3 (KHTML , like Gecko) Chrome/6.0.472.63 Safari/534.3","request_url":"/images/loading.gif","referrer":"http://blah_blah_blah","request_cookie":null, "return_code":200,"response_cookie":null,"byte_size":9754,"request_protocol":"HTTP"},"visitor":{"visit_unix":1286859600,"visit_unix_block_hour":1286859600,"geo":{"city":"blah" ,"region":"blah","organization":"blah","country_code":"blah","country_name":"blah","country_code3":"blah"},"visit_date":"2010-10-12 00:00:00","visitor_i p":"111.111.111.111","visit_date_block_hour":"2010-10-12 00:00:00","visitor_port":49800},"haproxy":{"listener_queue":0,"total_time_waiting_in_queue_ms":0,"feconn":1687,"haproxy_da emon_pid":5318,"total_time_to_establish_tcp_conn_ms":0,"beconn":1657,"listener_name":"slideshare","request_processing_time_ms":0,"srv_conn":32,"server_name":"blah_backend", "total_session_duration_time_ms":5013,"retries":0,"frontend":"srvA","termination_state":"cD--","haproxy_ip":"10.17.111.8","srv_queue":0,"total_time_to_receive_client_request_ms": 13,"actconn":1766,"haproxy_daemon":"haproxy"},"caching":{"x_varnish_cache_cur":2021094722,"x_varnish_cache_orig":2015028484,"x_varnish_cached":true},"app":{"x_bench_route_control ler":null,"x_bench_route_action":null,"x_bench_db_count":null,"x_bench_db_time":null,"x_bench_route":null}}

As the above snippet says, varnish sent back it's with two X-Varnish header values (2021094722 and 2015028484). However it resulted in connection in termination state on haproxy.

I am really confused about this. Please help me understand, why this can happen.

Thanks,

Mayank

share|improve this question

migrated from stackoverflow.com Dec 9 '10 at 17:16

This question came from our site for professional and enthusiast programmers.

1 Answer 1

I didn't see that post. Just for the record, "cD" flags indicate client timeout, so it's not related to varnish but to the clients (the other side). If too many clients experience a timeout, it's possible that your haproxy config is wrong (maybe too small client timeout).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.