I have created a getList api in golang. Now I am trying to call the getList api from my php function using php-curl.
I am making thousands of request from my php function. However, around 15k requests are served properly but after 15k - 20k (number varies)
and further requests, Curl CURLINFO_HTTP_CODE
return 0
and response is ""
and curl_error return empty string.
Also the curl_errno return 7
My golang getList api is simple. It takes data from db and returns it. It Does not contain any
goroutines.
I don't understand that why after 15k-20k requests
it starts giving me empty response. Don't know if it is curl-php
problem or golang api
problem. Also It can be that my golang api
is denying serving the requests.
Please help.
Have you tried to test it with HTTP testing tools like ab, httperf, jmeter or alike? * Try to run them with different number of requests and simultaneous requests.
First put static file to the webserver and try to fetch it in the same manner. Do you see such problems? If yes, there can problems with network configuration, few buffers, sockets maxfiles and so on.
If not - try to feed this static file with golang app. If you see problems investigate them in golang settings.
If no, check your app with db config. If there are problems check DB connections. May be they're not properly closed and got exhausted.