dbsessions and max_allowed_packet

dbsessions and max_allowed_packet

by Ricardo Santos -
Number of replies: 3

Hello all,

Here at University of Aveiro, Portugal, we have Moodle 2.4 installed for our students. If we have dbsessions configured to use MySQL we have a lot of this erros:

[error] [client 192.168.xxx.xxx] Can not write database session - please verify max_allowed_packet is at least 4M!

But we are 100% sure that the max_allowed_packet is bigger than 4M.

Any of you guys have the same problem?

 

Regards,

ricardo

Average of ratings: -
In reply to Ricardo Santos

Re: dbsessions and max_allowed_packet

by Adam Durana -

Are you certain that the max_allowed_packet is set correctly in both the MySQL client and server configuration?  Some people mistake the setting as only a client-side or server-side setting, but really it is a setting that can be set on both sides.

Do you have any idea what size your sessions are?  The debug option to print performance information for each page load will show the session size at the bottom of the page.

In reply to Ricardo Santos

Re: dbsessions and max_allowed_packet

by Stéphane Poinsart -

Hello,

It's quite simple to check, just type in a mysql console :

 show variables like 'max_allowed_packet';

Value is in bytes so it has to be > 4 000 000

There seems to be something unhealthy with moodle using $_SESSION for completion "caching"... Sometimes it really get bloated but i have not been able to pinpoint the problem yet, it does not happen all the time.

If your infrastructure allows (single frontend), consider using files for session and not database.

Regards,

 

Stephane

 

Average of ratings: Useful (1)
In reply to Stéphane Poinsart

Re: dbsessions and max_allowed_packet

by Miryam Moreno Pacheco -

Hello Stéphane

How can you use files and not the database for the sessions???

I have the same problem with a high value in max_allowed_packet

Thanks.

Miryam