Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old February 6th, 2002, 09:29 PM
JeffCT JeffCT is offline
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
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.

Reply With Quote
  #17  
Old February 7th, 2002, 12:30 PM
TotalMonkey TotalMonkey is offline
Polynesian Monkey God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Monkeytown, USA
Posts: 57 TotalMonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 42 sec
Reputation Power: 7
Lightbulb

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

Reply With Quote
  #18  
Old February 8th, 2002, 07:16 PM
JeffCT JeffCT is offline
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
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.

Reply With Quote
  #19  
Old February 8th, 2002, 07:18 PM
JeffCT JeffCT is offline
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
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.

Reply With Quote
  #20  
Old February 8th, 2002, 07:23 PM
TotalMonkey TotalMonkey is offline
Polynesian Monkey God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Monkeytown, USA
Posts: 57 TotalMonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 42 sec
Reputation Power: 7
thanks for the ideas, i'll check it out

TotalMonkey

Reply With Quote
  #21  
Old September 11th, 2003, 07:11 AM
bucko bucko is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 bucko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #22  
Old September 11th, 2003, 08:51 AM
TotalMonkey TotalMonkey is offline
Polynesian Monkey God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Monkeytown, USA
Posts: 57 TotalMonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 42 sec
Reputation Power: 7
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.

Reply With Quote
  #23  
Old September 21st, 2003, 06:11 AM
bucko bucko is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 bucko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Simulate "real-time" updates in Flash using PHP-sockets or some other method?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT