Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Monitoring Service Suggestions
Old 08-07-2009, 01:29 AM Monitoring Service Suggestions
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
Hello,

I am looking for some ideas on a little project I am about to start. I want to create a monitoring service and looking for suggestions on the backend structure.

Lets say my service allows a member to enter a URL and the loaded page is checked for text, if the text is present the site is assumed to be 'up', if it doesn't the site is assumed to be 'down'.

Now lets say I have 100 members with 1 of these monitors each. What is the best way to call the script to check the service? At first I figured a cron job, but 100 cron jobs? What if I allow each member 5 monitors, thats 500 cron jobs, obviously you can see how that will get crazy and possibly unmanagable over time.

Then I thought maybe a cron job for each interval (monitors that check every 5min, 15min, 30min, 60min). So thats 4 cron jobs, maybe each could scan a database looking for members who have a 5min monitor and then runs the script.

It seems like there are alot of possibilities, so wondering if someone has some knowledge on this or how other services do it. Im trying to think in terms of ease of managment and server load.

Any ideas?

Thanks in advance!
bmp99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-07-2009, 02:13 AM Re: Monitoring Service Suggestions
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You can do this with one cron job. Set up your script to check each site in a loop. Keep track of when each site was last checked and set up one cron to run the script in whatever interval you think appropriate. Assuming you are running this script on a shared host or otherwise don't want it to have to run through the entire database of sites to check in one go, all you have to do is record the start time and stop the loop once you exceed a certain amount of time.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-07-2009, 02:34 AM Re: Monitoring Service Suggestions
Novice Talker

Posts: 13
Trades: 0
Regardless, this probably won't work well if you do not have multiple servers available to do the monitoring. There will be a point where you will need more than the 5 minutes to monitor all the sites in your DB (every 5 minutes) - simply because some sites are slower than others.
premiumscripts is offline
Reply With Quote
View Public Profile
 
Old 08-07-2009, 02:48 AM Re: Monitoring Service Suggestions
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
Hello,

Thank you for the input!

Currently I am going to be running this off of 1 dedicated server. My plan would be to have the service free for users who do not mind longer intervals, and then eventually start a paid membership for those who want more monitors and shorter intervals. These folks would go on a separate server. Hopefully with a little time and patience I can start adding more servers which will pay for themselves.

More input is welcome. im just trying to consider all possibilities (good and bad) and try to build a strong foundation.
bmp99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Monitoring Service Suggestions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13750 seconds with 12 queries