mysqlasp.netweb-servicesscalabilitypersistent-connection

Should I use persistent connection on my webservice?


I have an WebService coded in asp net mvc4 that runs in a cloud server. This cloud server have an IIS 8 and a mysql server. This server is dedicated to this application.

I have a growing number of request to this server. Each request requires a connection to the database (70% of the queries are simple 'select', 25% are joins with 2 or 3 tables, and 5% are inserts).

The server access the database and give as answer a simple xml with the data fetched (the xml is around 0.2 kb to 2kb)

The webservice is always running in the server.

With each request, my webserver opens a connection the database (stored in the same machine), operate, close the connection then respond with a xml.

Nowadays it only happens a few times per minute. My connector class is a Singleton.

In this scenario, should I make this connection persistent? Will this help to improve the scalability of my app? Any adivices on what should I do to make it more scalable?


Solution

  • A few points: