Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:50:03+00:00 2026-05-26T20:50:03+00:00

I have a shoutbox which is coded in PHP and Javascript and uses MySQL.

  • 0

I have a shoutbox which is coded in PHP and Javascript and uses MySQL.
It functions like this.. We have a refresh.txt file that checks for new shouts, if there is a new shout there is a call to the database to grab the new shouts.

Now as we all know the main problem with shoutboxs is the CPU usage.
So I was wondering if there was a way to count active users without it adding too much extra stress on the server.
Maybe via Javascript?

Unfortunately I do not have any source code to hand as it would be a new feature added in there.
Any help would be great, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:50:03+00:00Added an answer on May 26, 2026 at 8:50 pm

    Are these users logged in with a PHP session? If so, just count the number of active session files in the session save directory. That’s not CPU-intensive and involves no database calls.

    Further, if you’re still avoiding database calls for this, you could have a private file keep track of the different clients (e.g. IP addresses) and when they last requested a resource from the server. More on this in this question.However, if multiple users visit from the same network (e.g. schools or businesses) then you have a logical error, and the solution is to log individual users with cookies or sessions.

    You may also be interested in long polling (Javascript). It keeps a connection open with the server and occasionally checks to see if there’s new data. This can be useful when counting the number of active users without, per-se, sessions or cookies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a php/mySQL/ajax shoutbox and have run into a small snag. On
I'm working on a project right now that is a shoutbox. Since I have
I have a script set up on a site which is a static shoutbox
I am designin a shoutbox which is AJAX based. http://businessgame.be/shoutbox.php The script works perfectly
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you managed to get Aptana Studio debugging to work? I tried following this,
Have had to write my first proper multithreaded coded recently, and realised just how
I have a shoutbox and I want to keep the scroll to bottom same
I know this is quite a vague question -- sorry about that. If I
Have created simple Ajax enabled contact forms before that have around 12 fields -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.