Cache list info in Sympa::Scenario::verify to reduce overhead of pinfo… #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our site has approximately 6000 lists and 600,000 subscribers. In order to do performance testing of our upgrade to Sympa 6.2, we created a demo server and loaded it with that many lists and subscribers. We found that the lists index page could take over a minute to load.
Profiling with NYTProf indicated that copying the
%pinfo
hash inSympa::Robot::list_params()
was the primary source of the time spent insidedo_lists()
, once wwsympa.fcgi was initialized.Since
Sympa::Scenario::verify()
was the primary caller ofSympa::Robot::list_params
during the list index, that code seemed to be a likely place for some caching. Robot parameters can change (say when topics are updated), so the cached data is updated every$picache_refresh
seconds.With this patch, lists index page performance with our demo Sympa 6.2.22 installation is approximately 3 seconds, instead of over 60. And it is comparable to our existing installation's performance.
The before and after profiling data is attached as
nytprof-picache.zip
:nytprof-6.2.22
nytprof-6.2.22-picache
The profiling data represents 5 successive requests to
/sympa/lists
to a single instance ofwwsympa.fcgi
running on our loaded demo server. We selected 5 requests instead of just 1 in order to reduce the impact of the significant overhead of simply starting wwsympa at all.While I am not familiar enough with Sympa's design to be sure this is the very best way to approach this performance issue, this is an attempt to avoid breaking things while at the same time making things run acceptably fast.
--mic--
nytprof-picache.zip