0

When i am posting data from c# application(Windows server) to PHP page which runs on another server(Ubuntu) using POST method,

i am posting minimum 1000 request per second to PHP page,

c# application is a multi threading application, once it receives the data it post the data to php page

when i continuously posting datas i'm getting posting timeout error on c# application, once i restart the application it works for few hours. [Note: due to php takes time to finish the task so new request are waiting , it creates queue and its waiting time exceed more than 2 min and im getting timeout error].

Both of our server use maximum 50% of CPU and RAM usage

i check on both c# code and PHP code both are working fine there is no issues or bugs

and i check on mysql configuration also fine but i dont know about apache config.

Apache config are set as default

what i think is may be i should config apache or php to handle 1000 request per second, i dont know exactly because same code working fine until clients request increased.

thanks in advance buddy :)

Vetri Vel
  • 13
  • 3

2 Answers2

0

I think you might be hitting a TCP Port Exhaustion issue. If you are making many sequential calls to another server, and dont manage the TCP connections properly your OS will not immediately release the TCP Port connection it created for the outgoing call, and will assign further OS resources to the next call. I think the default TCP Port release time can be as high as 2 minutes.

See How do I prevent Socket/Port Exhaustion? for further details. To be sure we'd need to see your C# code to see how you are releasing the resource you use when creating the WebClient call.

If it is a port exhaustion issue, then you are going to have to manage your outgoing calls to the PHP server using a manually created pool of WebClient instances - even releasing the WebClient may not immediately release the OS resources that the WebClient made use of.

Community
  • 1
  • 1
PhillipH
  • 6,182
  • 1
  • 15
  • 25
  • It was issue on ubuntu config , i didnt enable fast cgi/fpm, now its works fine. – Vetri Vel Dec 17 '16 at 11:20
  • It would be helpful if you posted both the problem you encountered and how you fixed it - this will mean people searching for a post like your original problem will find out what caused it in your case. Just telling me "I fixed it" without actually giving the solution isn't helpful to people who find the same problem in the future. The SO resource is both a "helpline" and a problem/solution resource. – PhillipH Dec 18 '16 at 22:11
0

thank u for kind reply bro, it was config issue on ubuntu server i didnt enable fast cgi now its works fine

Vetri Vel
  • 13
  • 3