Performance question

Performance question

Postby TillmanZ » Tue 14 Nov 2006 04:02

Hi there,

in my current project I am looking at a UDP server which is spawning a thread for each incoming request. This would probably peak at around 50 requests per second.
My question is whether I shall open/close a connection to mySQL within each thread or whether I should create a producer/consumer relationship where the UDP threads would lock a list and queue the request (with callback info) and I would have one mySQL thread working those requests and calling back the individual threads with the results.
Or maybe you suggest a completely different approach?

Thanks for your support!

Best regards,

Tillman

P.S. I remember that I once saw an exception stating that I have reached the maximum open connection pool size - what kind of limit is imposed and is that adjustable?
TillmanZ
 
Posts: 19
Joined: Sat 13 May 2006 04:11

Postby Alexey » Tue 14 Nov 2006 09:36

If you don't forget to close your connections, you would never get any exception about reaching maximum pool size. Anyway this size is adjustable (via connection string attributes).
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Serious » Wed 15 Nov 2006 09:39

Using connection pool is most recommendable practice.
When using single connection you will face the challenge of connection lifetime and others. I think that it is better to use connection pool. This allows you to use as less as possible physical connections with better performance. The approach with queuing can be used when there are too much user requests that produce too much connections. In this case I recommend to use connection pool in combination with queuing.
Serious
 

Postby TillmanZ » Thu 16 Nov 2006 17:57

Thanks for your advice.
I will give it a try with the connection pooling.

If I run into a road bump I will let you know. :-)
TillmanZ
 
Posts: 19
Joined: Sat 13 May 2006 04:11

Postby Alexey » Fri 17 Nov 2006 12:06

Waiting for your notification :)
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL