Is there a way to estimate actual number of concurrent Moodle users?
Choose some window of time (e.g. 1 minute, 5 minutes, 30 seconds, 1 second).
You can a query like
SELECT DATE_TRUNC('minute', to_timestamp(timecreated)), COUNT(1) FROM logstore_standard_log GROUP BY DATE_TRUNC('minute', to_timestamp(timecreated)) ORDER BY COUNT(1) desc
That gives a reasonable estimate.
You can do a similar count on you Web server logs as a cross-check. That is likely to give a slightly higher number.
For those using SQL Server this is a query you can use to find the number of requests per minute:
;WITH logrows AS
SELECT TOP 10000 mlsl.id, mlsl.userid, mlsl.relateduserid, mlsl.timecreated
FROM dbo.mdl_logstore_standard_log mlsl
ORDER BY mlsl.id DESC
SELECT COUNT(*) AS RequestsPerMin, l.timecreated/60 AS MINUTES
FROM logrows l
GROUP BY l.timecreated/60
SELECT t.RequestsPerMin, DATEADD( hour, -5/* ignore DST */, DATEADD(minute,t.MINUTES, CAST('1970-01-01 00:00:00' AS datetime))) AS ESTTime
FROM TMP t
ORDER BY ESTTIME DESC
Thank you very much for the helpful query.
I would just like to point out that it might be necessary to work on unique 'userid' field values. For example, a similar query is giving me a maximum of 268 'contemporary' users per minute on a given date. Turns out to be 268 '\core\event\grade_deleted ' events triggered by the same IP - some admin deleteing some quiz attempts, I guess.