Bitcoin Forum
November 14, 2024, 02:29:24 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Requests processing to bitcoind work slow. Please, help.  (Read 638 times)
vadim24816 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
March 13, 2013, 10:28:26 AM
Last edit: March 14, 2013, 05:26:32 AM by vadim24816
 #1

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.
vadim24816 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
March 15, 2013, 02:18:53 PM
 #2

 Huh
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 15, 2013, 02:24:31 PM
 #3

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.  
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!