|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Well that changes things then I would say. Four updates per second and instant updates would probably need the socket server to work well with many users. My application contacted the database about once per 6-8 seconds, and handled 100+ concurrent connections. So 12-18 http requests per second (5-6 queries per request) is about what it handled, but in your case that would only be a 5 or so users. The updates weren't made to be completely real time (instant) either, just needed to get info from the server. I'd still check for bottlenecks at the server end first, because minimal hardware should still be able to do 12+ requests per second, especially on a LAN.
Last edited by JeffCT : February 6th, 2002 at 09:32 PM. |
|
#17
|
|||
|
|||
|
Well,
I've finished my analysis, and it turns out my webservers (both Xitami on a 650MHz AMD Athlon WinPC and Apache on a 233MHz AMD K6-2 Linux) are just unable to handle the tremendous pounding that my Flash movie slams it with (between 4-6 hits per second with DB I/O). Evidence showed that the CPU and memory resources were maxxed out (both machines) using the 4-6 hits/sec movie both with and without database access, while a 1 hit every 4 seconds movie showed only a little over normal (i.e. no http hits) resource use for both with and without database access. I really should have provided more detail in the explanation of my original question, but it took me some pretty deep delving into the subject (i had to read a few chapters on C network programming) in order to really define what I was trying to do vs. what I need. Thanks, Jeff for sticking with me through this. I'll post my results to this thread when I've finished my little project for anyone who's interested in seeing how I got everything to work (assuming I really can! ).Later, TotalMonkey!
__________________
"We're all - monkeys!" -- Jeffrey Goines, 12 Monkeys |
|
#18
|
|||
|
|||
|
Maybe it's because you're using Xitami on Windows...
I was using Apache on Red Hat Linux 7.1, handling 15+ requests per second (5-6 database accesses per request) with no problem, minimal hardware. I was using MySQL as the backend. |
|
#19
|
|||
|
|||
|
You may want to look into Java for your XML socket server. With Java you could toss together a server in minutes. Many beginners' Java books will have you make a server as one of the examples, so it's very easy. Plus it would be platform independent. I'd just do that.
|
|
#20
|
|||
|
|||
|
thanks for the ideas, i'll check it out
TotalMonkey |
|
#21
|
|||
|
|||
|
real time problems
Hi TotalMonkey,
If you are still working on this problem I would be eager to swap notes. I'm using php and mySQL with between 4 and 16 users for an online bridge game and have been struggling with what seems to be exactly the same problems that you have had. I think I have narrowed the problem down to the point where I connect to the database (which is why I was also wondering about sockets). It all goes swimmingly well much of the time, but every now and then freezes up. Have you made any more progress? |
|
#22
|
|||
|
|||
|
Well bucko,
I did the research and found that socket servers are the way to go if you to simulate real-time in multiplayer Flash games. I tested a few socket servers with my game, and unfortunately found that for my purposes it wouldn't work. The problem for me really wasn't the Flash/sockets/PHP/MySQL combination -- that all worked fine. The real limiting factor was LAG, internet lag. For a "true" real-time multiplayer experience where you can't have any lag, Flash is not really an option. For card games (and other turn-based games) where lag isn't an issue, Flash and a socket server will work beyond your wildest dreams. (ok, maybe not your WILDEST dreams, but it'll work.) By the way, if you're having Flash constantly access the web server (like more than once every two seconds), you'll jam that HTTP connection up faster than traffic in L.A. And if you have 4 to 16 users with Flash clients constantly accessing the HTTP server, then things will be at a stand-still. For multiplayer, a socket server is really the only way to go.*** One last note, I discovered the hard way that Windows and Linux/Unix do sockets roughly the same way, but the methods involved in programming sockets is completely different between the two. So make sure you do the research if you're going to write your own socket server, there's plenty of info out there on it. Hope that helps, TotalMonkey *** [note: I changed "database" to "web/HTTP server" in this paragraph. When I did my tests earlier, it turned out that MySQL can handle that kind of heavy traffic, but web servers apparently aren't really designed for it. So sorry if there was any confusion! --TM] Last edited by TotalMonkey : September 12th, 2003 at 04:17 PM. |
|
#23
|
|||
|
|||
|
Thanks for your advice TotalMonkey. I have had a look at sockets and it looks like they are just the ticket. I appreciate your help.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Simulate "real-time" updates in Flash using PHP-sockets or some other method? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|