icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Coding and Programming » Efficiency with the comet/ajax concept?

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old February 18th, 2008, 11:41 PM   #1 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
117 posts
Gave thanks: 3
Thanked 4 times
Efficiency with the comet/ajax concept?

Alright, what I got going on is actually two things. I'm trying to find out if this would cause too much of a load on the server for me to use and if anyone can think of a more efficient way to do it.

Below is attached my comet/ajax test. The way it works, is "test.php" is the backend. It forces the javascript HTTP object to stay connected for 5 seconds. I don't really intend to make it connect for 5 seconds. I intend to make it connect until data is slapped on the page. Now my questions are, would this cause too much of a server load? Does surpass have anything against it? I'm pretty sure I wont be able to use this here, so I'mma just pull out my alternatives, but I'm seeing if anyone can opinionate on this topic for me.
Attached Files
File Type: zip comet-ajax.zip (1.4 KB, 1 views)
__________________
HD.C
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 2:17 AM   #2 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,873 posts
Gave thanks: 44
Thanked 127 times
The only potential problem I see is that well, yeah, it could use some cpu and memory, but mostly that it's holding an apache connection for 5 seconds (minimum) rather than the normal minimum, which is usually shorter. And depending, you might be opening your MySQL connection for that long as well.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 9:29 AM   #3 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
117 posts
Gave thanks: 3
Thanked 4 times
I have no idea how to go about seeing how much of the resources it's actually using. My test environment ain't very sophisticated and I've not figured out how to do it with my reseller account yet. All I can find is the server usage... not the detailed information on what user is using what.

I know I can't exceed this:
Quote:
Memory usage may not exceed 10% per domain/file/application
CPU usage may not exceed 20% per domain/file/application
Apache connections may not exceed 30 connections
15 MySQL maximum user connections allowed
350 emails per hour, per domain
but I don't know if I would be exceeding that...

Also, the minimum connection time wouldn't really be 5 seconds. The idea is to provide the data as it happens. Apache has a timeout limit default of 30 seconds. This causes for more reconnections. I'll probably end up making a server that runs on my own personal machine to be a median for data, but I still wanna to get a solid grasp on the feasibility of this concept. Maybe a reoccurring ajax connection without the HTTP connection being held would simply be enough to not peek resource use?
__________________
HD.C
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 12:50 PM   #4 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
117 posts
Gave thanks: 3
Thanked 4 times
My alternative method would be to have a home programmed HTTP server that maintains 1 continuous connection to surpass MySQL and it'll only have to fetch the data for the users as they all connect to it via HTTP. IE: Php sockets xD. I figure it'll do more to my resources than surpass hosting's. I need to run tests though. I'm trying to get the administrators to help me out on accomplishing my goal, since I can't be sure if I can trust my little server load icon button thing.

PS: Sorry for the double post... the edit button ain't showing up for my last post anymore =(
__________________
HD.C
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 1:09 PM   #5 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,873 posts
Gave thanks: 44
Thanked 127 times
Hmm. All I can really suggest is benchmarking it. See what kind of CPU and memory it's going to require.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 1:13 PM   #6 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
117 posts
Gave thanks: 3
Thanked 4 times
^_^ That's where I fail at as a programmer.... I don't know how to really "benchmark" cpu usages and know that my benchmark is accurate. Any tips or suggestions before I hit google up?
__________________
HD.C
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 1:47 PM   #7 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,873 posts
Gave thanks: 44
Thanked 127 times
Not sure with PHP... There's probably a framework out there that can simulate "x" users, or even determine how many users it can support until load is "y".
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 2:02 PM   #8 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
117 posts
Gave thanks: 3
Thanked 4 times
I'll figure something out. I'mma have a lot of trouble with my alternative solution. I just realized how hard XSS is. I might not be seeing it till a major browser update is done. I'm not even sure IE will support the access-control headers when it's all set in motion by w3, because IE is already failing at maintaining w3 standards.
__________________
HD.C
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 19th, 2008, 2:18 PM   #9 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,873 posts
Gave thanks: 44
Thanked 127 times
Why couldn't Adobe do cross-domain stuff like access-control headers? It's so simple. It would be smart for there to be a standardized way of doing it...
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

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