Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Users Currently Online

#31 2005-08-09 07:20:13

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: Users Currently Online

Thanks a lot Manfre, the above place holder plugin works – no problem at all. sorry for bothering with the plugin. If i can help with graphics, design issues or something else, please let me know!

Offline

#32 2005-09-27 11:11:30

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: Users Currently Online

@Manfre, what was your idea with the above code?
Even on 4.0.1 i can not install the plugin.. but i really like :)

Offline

#33 2006-12-13 07:09:26

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: Users Currently Online

I have 3 sites using the mem_online_users plug-in and have started experiencing the sites going down quite frequently. My host finally narrowed it down to all 3 of these sites having this plug-in in common. Here is what they said:

“There is a query on your website that is causing httpd to timeout before mysql can return data. You currently have over 100 of the following type of query:
select COUNT as OnlineUsers from `txp_log` where (UNIX_TIMESTAMP(time) >= 1165967964)
You should review your code and find out where that query is coming from exactly. This is a problem with either the amount of data to be sorted or with the query itself. “

So, for now, I’ve disabled this plug-in, but my clients really want this capability on their sites. Any input?

Thanks!


90+ Textpattern installs and still going…

Offline

#34 2006-12-13 07:25:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Users Currently Online

You currently have over 100…

That means:

  • You are using the tag, per page, more than you should be. You need to do a tag trace and find out where you’re using it and trim it back to only one use per page.
  • If you’ve got a lot of online users at any given time, you need to greatly reduce the timeout number.

Offline

#35 2006-12-13 08:58:28

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: Users Currently Online

Thanks so much, Mary! Has anyone told you how awesome that you are yet today?

I’ve uploaded my tag trace here since it is so long.

I only see the OnlineUsers tag used once on the page, but I’m not that in-depth with this code.

I didn’t put a time-out choice in the tag, leaving it at the default of 600, which the plug-in help says is 10 minutes.

Any suggestions and help is, as always, GREATLY appreciated!

Thanks again.


90+ Textpattern installs and still going…

Offline

#36 2006-12-13 11:15:02

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Users Currently Online

Interesting.

I can see nothing wrong in the SQL query itself. If your default page is like the rest, then you’re not over-using it (yep, just used once on that one); should double-check the rest of your pages, though – you know what to look for now. :)

What’s the setting you are using for your logs (in the admin prefs)?

Offline

#37 2006-12-13 21:00:59

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: Users Currently Online

The query took over 4 seconds. You should drop the timeout to a lower value (300 or lower). After doing this, check the tag trace to see how long the query took. I suspect that the UNIX_TIMESTAMP(time) is slowing things down. I will look in to optimizing the query a little bit more and possible adding a table index to make it run faster. I am also going to add to my todo list, the ability to have it cache the result for a configurable amount of time, instead of calculating every page load.

Offline

#38 2006-12-13 21:17:52

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: Users Currently Online

Okay, I made a small change that should speed things up a little bit. Download 0.3 and give that a go.

Changes:
- timeout arg defaults to 300 instead of 600
- No longer using UNIX_TIMESTAMP

Offline

  1. Index
  2. » Archives
  3. » Users Currently Online

Board footer

Powered by FluxBB