Update Joomla to 3.8.4
Check the number of visitors.
The number of visitors is abnormally high.
For example it shows 34 000 visitors, although there are 10 visitors based on Google Analytics.
Received an error message after the update:
Disabling cache did not change the situation.
Thread in Joomla forum: https://forum.joomla.org/viewtopic.php?p=3511468#p3511468
I have the same / similar problem with members,
After updating to version 3.8.4. since then the users online module is malfunctioning,
it shows 2 or 3 times more logged users than what it was before.
I tried to change Session Lifetime nothing changed,
Session Handler is DB , i changed it to PHP and again back to DB because nothing change again
Try to look at this line https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Application/CMSApplication.php#L160 from your Joomla installation, change 5 to 2, then check it again
That's the only change from 3.8.3 to 3.8.4 I know could cause this issue
To be more clear, change the code in that line from
if ($handler !== 'database' && $time % 5 === 0)
if ($handler !== 'database' && $time % 2 === 0)
Thank you for the suggestion. I changed the code but unfortunately it did not fix it.
Did you also change Session Lifetime after update? 60 is a high value, maybe change it to a lower number like 15 would help
As noted in the merged pull request, this is the trade off of the performance fix put in place to keep this query from being arbitrarily executed on every even numbered second.
If you are really reliant on these modules reporting accurate numbers, you will need a cron job to force garbage collection of expired metadata and/or sessions. With the referenced pull request applied this cleanup will not run at all when using the database handler because of the mixed storage/purpose of the session table and the frequency of cleanup when other handlers are in use is reduced from once every 2 seconds to once every 5 seconds (in effect, you go from running this query a max of 30 times per minute to 12 times per minute).
Thank you. No, the session lifetime is the same as before. It was increased to 60 about a year ago, because members of the site complained about a too short session... I just tried with 20, but the issue remains...
I'm sorry mbabker, as English is not my first language and I'm not a developer, this information is a bit confusing for me :) You are saying that I should create a cron job? I know how to create one in Cpanel but unfortunately I can't come up with a command.
@mbabker Is onAfterResponse a correct event trigger? Look like a typo, onAfterRespond is correct event trigger
Could someone please change this line https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Application/CMSApplication.php#L163 to
Then check to see whether the issue sorted?
thanks! I tried it and the counter went from 35 000 to 1500. This can actually be a realistic number as I stated a Facebook campaign and it reflects the number visitors within 1 hour.
I will keep an eye on it, but indeed it seems to be fixed now.
Can others confirm?
@i did it but nothing look fixed,
i have problem with number of users not with the visitors.
Maybe another typo ?
|Closed_Date||0000-00-00 00:00:00||⇒||2018-02-01 15:45:11|
For DB session garbage collection may not be called at all.
You can check that by putting that code in your template index.php.
<?= ini_get('session.gc_probability'); ?>
ini_get('session.gc_probability'); is equal to 0 then php won't clear your database table
Hi Tuan and others, having the same problem. My user session table has grown to a staggering 700 Mb with 66.000 entries. The logged in users have gone from at maximum 100 simultaneously logged in to 1000 and growing. The admins who are logged in are now over 20 even though there is only one admin account. Anything to do about it?