|
|
#1 (permalink) |
|
php, wha?!
Comfy Contributor
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. |
|
|
|
|
|
#2 (permalink) |
|
after g, before i
Super #1
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.
|
|
|
|
|
|
#3 (permalink) | |
|
php, wha?!
Comfy Contributor
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:
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? |
|
|
|
|
|
|
#4 (permalink) |
|
php, wha?!
Comfy Contributor
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 =( |
|
|
|
|
|
#6 (permalink) |
|
php, wha?!
Comfy Contributor
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?
|
|
|
|
|
|
#7 (permalink) |
|
after g, before i
Super #1
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".
|
|
|
|
|
|
#8 (permalink) |
|
php, wha?!
Comfy Contributor
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.
|
|
|
|
|
|
#9 (permalink) |
|
after g, before i
Super #1
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...
|
|
|
|