Re: Event driven server that wastes CPU when threaded doesn't

2006-11-05 Thread Snor
> You got a lot of long-winded replies, but the short reply is that > Twisted has packaged solutions for this. > Seehttp://twistedmatrix.com/projects/core/enterprise > > "Twisted provides an interface to any Python DB-API 2.0 compliant > database through an asynchronous interface which allows da

Re: Event driven server that wastes CPU when threaded doesn't

2006-11-02 Thread Magnus Lycka
Snor wrote: > I'm attempting to create a lobby & game server for a multiplayer game, > and have hit a problem early on with the server design. I am stuck > between using a threaded server, and using an event driven server. I've > been told time and time again that I should use an event driven serve

Re: Event driven server that wastes CPU when threaded doesn't

2006-11-02 Thread Bryan Olson
Jean-Paul Calderone wrote: > On Tue, 31 Oct 2006 07:33:59 GMT, Bryan Olson <[EMAIL PROTECTED]> > wrote: >> Snor wrote: >>> I'm attempting to create a lobby & game server for a multiplayer game, >>> and have hit a problem early on with the server design. I am stuck >>> between using a threaded serv

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-31 Thread Bjoern Schliessmann
Fredrik Lundh wrote: > by running the database queries in one or more separate threads, > you can still serve requests that don't hit the database (either > because they're entirely self-contained, or because they only rely > on cached data). Nothing that couldn't also be solved without threads.

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-31 Thread Jean-Paul Calderone
On Tue, 31 Oct 2006 07:33:59 GMT, Bryan Olson <[EMAIL PROTECTED]> wrote: >Snor wrote: >> I'm attempting to create a lobby & game server for a multiplayer game, >> and have hit a problem early on with the server design. I am stuck >> between using a threaded server, and using an event driven server.

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-30 Thread Bryan Olson
Snor wrote: > I'm attempting to create a lobby & game server for a multiplayer game, > and have hit a problem early on with the server design. I am stuck > between using a threaded server, and using an event driven server. I've > been told time and time again that I should use an event driven serve

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Fredrik Lundh
Bjoern Schliessmann wrote: >> If that is not an option, then you are faced with a problem of >> connecting a threaded programming model with an event based model >> (twisted and and such). > > I don't really see how threads could avoid a problem with delays in > one connection ... by running the

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Bjoern Schliessmann
Nick Vatamaniuc wrote: > If that is not an option, then you are faced with a problem of > connecting a threaded programming model with an event based model > (twisted and and such). I don't really see how threads could avoid a problem with delays in one connection ... Regards, Björn -- BOFH

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Nick Vatamaniuc
Good point. enterprise.adbapi is designed to solve the problem. The other interface was deprecated. Thanks, Nick Vatamaniuc Jean-Paul Calderone wrote: > On 29 Oct 2006 13:13:32 -0800, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: > >Snor wrote: > >> I'm attempting to create a lobby & game server fo

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Nick Vatamaniuc
Try the --skip-networking option for mysqld Paul Rubin wrote: > "Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > > The simplest solution is to change your system and put the DB on the > > same machine thus greatly reducing the time it takes for each DB query > > to complete (avoid the TCP stack com

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Felipe Almeida Lessa
29 Oct 2006 14:18:02 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid>: > "Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > > The simplest solution is to change your system and put the DB on the > > same machine thus greatly reducing the time it takes for each DB query > > to complete (avoid the TCP

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Paul Rubin
"Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > The simplest solution is to change your system and put the DB on the > same machine thus greatly reducing the time it takes for each DB query > to complete (avoid the TCP stack completely). Since when do any db's let you avoid the TCP stack, even on

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Carl Banks
Snor wrote: > As this occurs, there is a > small amount of lag while the communication with the mySQL server takes > place, and there could be another 100 clients waiting to make a request > at this point, meanwhile the server is idling while waiting for a > response from the mySQL server - obvious

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Jean-Paul Calderone
On 29 Oct 2006 13:13:32 -0800, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: >Snor wrote: >> I'm attempting to create a lobby & game server for a multiplayer game, >> and have hit a problem early on with the server design. I am stuck >> between using a threaded server, and using an event driven server

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Nick Vatamaniuc
Snor, The simplest solution is to change your system and put the DB on the same machine thus greatly reducing the time it takes for each DB query to complete (avoid the TCP stack completely). This way you might not have to change your application logic. If that is not an option, then you are fac

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Bjoern Schliessmann
Snor wrote: > There is a lot of interaction between the clients and they would > often need to write to the same list of values, which of course > becomes a problem with a threaded server - so event driven solves > that problem, and I assumed it would solve all my problems. Which problem, and why

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Fredrik Lundh
Snor wrote: > Is the only solution to use a threaded server to let my clients make > their requests and receive a response in the fastest possible time? since the problem is that you need to wait for database anyway, maybe you could use one or more threads to deal with the database, and keep u

Event driven server that wastes CPU when threaded doesn't

2006-10-29 Thread Snor
I'm attempting to create a lobby & game server for a multiplayer game, and have hit a problem early on with the server design. I am stuck between using a threaded server, and using an event driven server. I've been told time and time again that I should use an event driven server design (that is, u