Author

Topic: Requests processing to bitcoind work slow. Please, help. (Read 643 times)

donator
Activity: 1218
Merit: 1079
Gerald Davis
If bitcoind is taking that long to respond it likely doesn't have sufficient resources however making adhoc requests against bitcoind directly isn't going to scale.

Instead have a background process on your webserver make a list transactions call against bitcoind say once every 15 seconds. Now store the results in a db on the webserver locally.  On each update you will need to perform some logic to compare the tx set in the database against the tx returned by bitcoind, find the new tx and update the database.

To respond to user queries the webserver would only poll the local database not bitcoind.  
newbie
Activity: 8
Merit: 0
newbie
Activity: 8
Merit: 0
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.
Jump to: