First things first, if your WCF service is IIS hosted, move it so it's self hosted. Hosting WCF services in IIS means you get all the latency of of IIS worker process management. I'm also assuming your database is SQL?
http://msdn.microsoft.com/en-us/library/ms731758.aspx[
^]
With self hosted a good grasp of WCF concurrency and throttling is required. So read this.
WCF Concurrency (Single, Multiple, and Reentrant) and Throttling[
^]
Beyond that, with out a better understanding of your code and database it will be difficult to advise you on the exact cause of the latency. That said, please don't post all your code.
First thing I'd look for are locks in the database. If a row is locked it can hold up an SQL query until unlocked.
The following describes how to check for record locks.
http://stackoverflow.com/questions/694581/how-to-check-which-locks-are-held-on-a-table[
^]
You can instruct SQL queries to read over locked records, returning the old value rather than the value waiting to be written to the database using the
NOLOCK
hint.
http://www.mssqltips.com/sqlservertip/2470/understanding-the-sql-server-nolock-hint/[
^]
It could also be that queries in SQL are not optimised well for specific parameter sets. You can look at this using SQL's
Execution Plan
SQL Tuning Tutorial - Understanding a Database Execution Plan (1)[
^]
Or it could be as simple as your indexes are a little messed up and you need to update your database statistics using
sp_updatestats
http://msdn.microsoft.com/en-us/library/ms173804.aspx[
^]
If IIS isn't causing your problem and your database isn't causing your problem then by a process of elimination, it must be your code.
A tool which should be in every developers tool kit is Redgate's Ant's Profiler. This tool will profile each line of your code whilst it executes in visual studio. The report will then show how long was spent on each line of code and as such where the slowest parts of your code are.
Redgate offer a free trial of the software.
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/[
^]