Jump to content

Site down after lots of user logins.


salmiak
 Share

Recommended Posts

I have a site with user login using the LoginRegisterPro module. Where I host an embedded youtube livestream (weekly). On that page I track the users activity using AJAX storing the time they spend on the page and what they vote for in a live poll(also using AJAX).

Often it works without issue (mostly around 150 users)

But when we go over about 200-300 concurrent users things started to slow down and I got hundereds of these errors: 

Error:  Exception: Unable to obtain lock for session (retry in 30s) (in /path/to/wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module line 96)

After a while the site  stopped responding.

What can I do to solve this?

Link to comment
Share on other sites

Check if the sessions table is really innoDB (it should be). Also, maybe try to decrease this value:

$this->set('lockSeconds', 50); // max number of seconds to wait to obtain DB row lock

But most likely, the DB engine doesn't have enough horse-power to handle the load. Are you on a shared hosting environment?

You might also try to install SessionLoginThrottle module (core), to prevent too many DB-hits from users who are trying to login without success (repeatedly).

  • Like 1
Link to comment
Share on other sites

I tried setting it to:

$this->set('lockSeconds', 1); // max number of seconds to wait to obtain DB row lock
$this->set('retrySeconds', 1); // seconds after which to retry on a lock fail

And after a load test with https://github.com/rakyll/hey

It seems to improve things from handeling max 10 requests per second (continiously) to about 35. 

A few questions:.

What would be the downside of this?
Why is it this high in the first place?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...