简体   繁体   English

Joomla 1.5:如何在基于joomla的Intranet系统中查找并发/活动用户数

[英]Joomla 1.5 : How to find number of concurrent / active users in my joomla based intranet system

I have a Joomla 1.5.10 based Intranet system. 我有一个基于Joomla 1.5.10的Intranet系统。 Sometimes we see that number of DB threads are too high and performance become down. 有时,我们看到数据库线程数过多而性能下降。 When I checked through Administrator section, I can see the number of logged-in users only. 当我通过“管理员”部分进行检查时,我只能看到已登录用户的数量。 These number is between 1000-5000 only. 这些数字仅在1000-5000之间。 is it correct to execute below query to find the concurrent active users: 执行以下查询以找到并发活动用户是否正确:

select count(*) from jos_session;

For example, If I execute above query and check the logged-in user through administrator, below is the data: 例如,如果我执行上述查询并通过管理员检查登录用户,则数据如下:

select count(*) from jos_session; = 2628
logged-in users visible from admin section = 1545

Both results are not matching each other. 两种结果都不匹配。 Also, what is the best way to find the concurrent / active users in my system at a time? 另外,一次查找系统中的并发/活动用户的最佳方法是什么?

I think just by analizing __session you won't get the info you need / want. 我认为仅通过分析__session就不会获得您需要/想要的信息。 If you need to understand what you see in back-end, check the module located at: 如果您需要了解在后端看到的内容,请检查位于的模块:

administrator\\modules\\mod_status\\mod_status.php

There are all the queries listed. 列出了所有查询。 Important is to understand that guest is an user which is not authenticated, and also client_id (front-end (0) VS backend authentication (1)). 重要的是要了解guest是未经身份验证的用户,也是client_id(前端(0)VS后端身份验证(1))。

Here is the thing: 这是东西:

  • jos_session stores all the sessions that have not expired jos_session存储所有尚未到期的会话
  • probably you have a SSO authentication mechanism, which means that the user probably get a new session id if it closes and opens again the browser. 可能您具有SSO身份验证机制,这意味着如果用户关闭并再次打开浏览器,则可能会获得一个新的会话ID。 Having more active sessions than users it's a clear sign that the session expiration time is set to high. active会话数多于用户数,这很明显表明会话过期时间设置得很高。

Just do a query against the jos_session : 只需对jos_session进行查询:

SELECT `username`, count(username) FROM `jos_session` WHERE 1 GROUP BY `username`

If too many users have a too large value for count , reduce the session lifetime. 如果太多用户的count太大,请减少会话寿命。

This way you will get a more realistic figure on how many users are at a certain time in the system, but again this is just a session, it does not provide you with exact information on how many users are actually performing an action on a website. 这样,您将获得一个更真实的数字,表明系统中在特定时间有多少用户,但这只是一个会话,它不能为您提供有关多少用户在网站上实际执行操作的确切信息。 。

To put it in plain English is like saying: I know that 1500 users opened the Intranet in the last [FILL IN SESSION LIFETIME] minutes. 用简单的英语来表达就像是说:我知道有1500位用户在[FILL IN SESSION LIFETIME]分钟内打开了Intranet。

会话设置

You need to understand how exactly do the DB threads get generated and why the value is high. 您需要了解如何精确地生成数据库线程以及为什么该值很高。

Basically, quoting the documentation , The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close(). 基本上,引用文档The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close().

Might be worth checking if you have something like a JavaScript polling your server with AJAX requests to get some info, which might run even if the user just has the browser open. 可能值得检查一下,是否有JavaScript之类的内容通过AJAX请求轮询服务器以获取一些信息,即使用户只是打开浏览器,该信息也可能会运行。

Hope this helps in a way or another. 希望这对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM