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 3347064
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:22:39+00:00 2026-05-18T01:22:39+00:00

In our application, we store the most number of users online. We do this

  • 0

In our application, we store the most number of users online. We do this by tracking what page each user is on currently and upon login, delete users who have been inactive for X minutes and then take a count of the users online, overwriting the most number online if this is higher.

How can we change this to track the number of users online over a time period, so we can look at a line graph of the number of users online. I guess we’ll need a cron to run every 1/2/5/10/20/30/60 minutes to track the number online? Then how would be store this data, the table would get very large. I would think the likes of Statcounter/Analytics would have a better way of storing this data.

Any pointers would be appreciated.

  • 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-18T01:22:40+00:00Added an answer on May 18, 2026 at 1:22 am

    There is no way to store it in less space. If you have a long period of time, you have a certain amount of data. It depends on the number of logins and length of intervals, whether you better store logins or samples of user count.

    Just store it with the highest sampling rate you need, it’s easy to group it for example by hour later:

    SELECT YEAR(sample_datetime),
           MONTH(sample_datetime),
           DAY(sample_datetime),
           HOUR(sample_datetime),
           AVG(user_count)
    FROM stats
    GROUP BY 1,2,3,4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our application currently stores bunch of configuraton & application specific data to files on
As our Rails application deals with increasing user activity and load, we're starting to
We use the APC user cache in our application, but I've started noticing various
One of our teams is going to be developing an application to store records
In our Delphi application, we use a TStringList to store strings and corresponding objects.
My application needs to, like most, store data. The application was previously used on
At this moment, all of our reports are currently written in stored procedures. We
I've got an application for our company that has to store settings in a
Our application stores records with shorter texts (strings of 100-1000 characters). It provides search
Our application uses a SQL Server back-end with many stored procedures. Recently, while trying

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.