There are 2 servers.
The first one has web-app on php 5.3, apache 2.2.23, linux 2.6.32, MySQL 5.1, it use for work with bitcoind the php library
https://github.com/mikegogulski/bitcoin-php, it works with cURL.
The second one has bitcoind.
First makes requests to second when
a) need check connection to bitcoin (1 time per 15 second)
b) need check for incoming payments for given bitcoin account. (1 time per 15 second)
The problems start when many users open the site. The first server start make responses (on requests to bitcoind) slower and then it takes about 5-10 second, so it's not good.
a) and b) checkings are initiated by clients browser, now when 10-15 users open the site, amount of Entry Processes becomes 5-6, and when they start to do something, it is Entry Processes overlimit. Now the limit is 25.
So I suppose, there are 25 simultaneously php sripts is processing. There is no Entry Processes overlimit if I commented requests to bitcoin on client side.
I had found out from debug it with xdebug and WinCacheGrind, that the problem in slow php script processing which make requests to bitcoind, exactly in php::exec_curl, it takes about 500ms per request.
My questions:
1. Is it good that request to bitcoin take so much time and how could I make it faster?
2. How can I decrease the Entry Processes amount?
3. How can I check incoming payments without repeating requests to bitcoind? Preferably without 3rd party services.
Appreciate any help.