Yii/Elastic Beanstalk/Sessions

I’ve got something strange that’s just popped up. I’m running Yii on Elastic Beanstalk, using DB sessions. Whenever a user logs out and tries to log back &

in, all hell breaks loose. Essentially they end up getting a series of 504 gateway timeout errors thereafter, and my CPU usage on my EC2 instance balloons to 100% CPU utilization. sometimes they can clear their cache and login, sometimes it takes quite a while before they can access the website again. Whatever the case, the CPU remains at peak for quite some time - often I’ve had to terminate the instance so that a new one can be spawned by the load balancer. Am I missing anything obvious here? I’ve done quite a bit of performance tuning and there aren’t any real huge queries/bottlenecks. I’m at a loss.

Is it possible that in the process of login or logout some never-ending redirection loop is called?

Can you emulate the behavior yourself?

What is written in the log files?

Check if you are sharing your session info between the difference instances.

Enable Load Balancer Generated Cookie Stickiness in the Load balancer configuration