graphite-project / graphite-web

A highly scalable real-time graphing system
http://graphite.readthedocs.org/
Apache License 2.0
5.89k stars 1.26k forks source link

[Q] Question regarding method connect #2716

Closed clalos2592 closed 3 years ago

clalos2592 commented 3 years ago

Hello

I am trying to find a solution for the issue below. I configured graphite-web as a frontend server (using the CLUSTER_SERVERS option). The respective calls are sent towards the backend servers (again another graphite-web instance is configured as a backend server). The initial requests take ~3.5s and the forthcoming ones ~0.3s (since memcached is used for caching purposes). I used a python profiler to analyse the python code. Please check my findings below.

[668] [INFO] [POST] Load Time: 3.258410692214966s ERROR:root: [668] [INFO] [POST] URI /render ERROR:root:[668] [INFO] 140265 function calls (132569 primitive calls) in 3.259 seconds Ordered by: internal time, cumulative time List reduced from 1577 to 100 due to restriction <100> ncalls tottime percall cumtime percall filename:lineno(function) 1 3.003 3.003 3.003 3.003 {method 'connect' of '_socket.socket' objects}

It seems that method connect takes ~3s. Both servers are on the same subnet. Is there any way to improve this ? Thanks a lot

clalos2592 commented 3 years ago

Issue is resolved. Graphite-web was trying to connect with the memcached server, but the memcached service was not running as expected. After fixing that issue, the responses come as expected.