https://bz.apache.org/bugzilla/show_bug.cgi?id=69841

--- Comment #3 from Ruediger Pluem <[email protected]> ---
(In reply to Ákos Szőts from comment #2)
> Created attachment 40115 [details]
> Patch diff
> 
> Thank you, it was quick!
> 
> In 2.4.65 still "apr_password_validate" is used instead of
> "ap_password_validate", so I had to modify the patch (attaching the diff),
> but otherwise it applied and I recompiled exactly how my distro compiled,
> then replaced the mod_authn_socache.so file.

This is because the patch was created for trunk and not for 2.4.x. Sorry for
not mentioning this.

> 
> Observations:

Thanks for reporting back.

> 
> The error is gone, the page loads without any error messages or crashes.
> 
> However, caching is effectively not done. With trace4, for a single page
> load, for every request I see multiple "mutex busy" messages. Altogether 104
> for 75 requests.

I decided to follow a similar pattern in the existing code to avoid too much
lock contentions, by just not using the cache if we cannot get the needed lock.
This is possibly the wrong decision and waiting for the lock might give a
better overall result. I will attach a new version of the patch (again against
trunk, hence have a look for the apr_password_validate difference). The patch
as provided does the same as the previous one, but you can play around a bit
with a hardcoded timeout value: LOCK_TIMEOUT is in microseconds and tells the
code how long to wait for a lock before giving up and not using the cache. A
good value here might give a fair balance between a good caching and avoiding
too much lock contention. Let me know your experience.

> 
> 1. Encryption standards require an algorithm with high computation power, so
> I use SHA512-CRYPT with many rounds. As I see, Apache is trying to crypt the
> password for every request and compare it with the DB result, which prolongs
> the web page loading time from a few hundred ms to 5 seconds.

ap_password_validate in trunk optimizes this, but it was never backported to
2.4.x:
See
https://github.com/apache/httpd/commit/40431c8d757f8bdaf0c1be4203ea5f79224e31de

> 
> 2. I still see many (20+) connections reaching the DB. I'd think that with
> caching that's reduced.

I am not sure if the number of connections matter as I don't know if they are
kept open, but I guess the points above are more important.

> 
> I use Apache in "event" worker mode.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to