Bitcoin Forum
December 11, 2016, 06:35:44 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3 »  All
  Print  
Author Topic: [solved/paid][1btc reward] PHP RPC commands freezing bitcoin  (Read 3665 times)
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 25, 2012, 08:45:56 AM
 #1

Okay so I'm trying to make use of the PHP martingale bot that's bouncing around, and after a while the bitcoin client freezes and jsonRPC fails to connect (the client stays frozen and won't start until the whole computer is restarted) it doesn't seem to be connected to anything specific, just after a while (30 transactions on one wallet, 1800 on another) cpu use of the client hits 25% and it freezes

bitcoind freezes then crashes

I'm in windows 7 with the latest client from bitcoin.org

Anyone know how to stop this?

edit : it seems to happen when trying to use the rpc at the same time as bitcoin is downloading a block

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
1481438144
Hero Member
*
Offline Offline

Posts: 1481438144

View Profile Personal Message (Offline)

Ignore
1481438144
Reply with quote  #2

1481438144
Report to moderator
1481438144
Hero Member
*
Offline Offline

Posts: 1481438144

View Profile Personal Message (Offline)

Ignore
1481438144
Reply with quote  #2

1481438144
Report to moderator
1481438144
Hero Member
*
Offline Offline

Posts: 1481438144

View Profile Personal Message (Offline)

Ignore
1481438144
Reply with quote  #2

1481438144
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481438144
Hero Member
*
Offline Offline

Posts: 1481438144

View Profile Personal Message (Offline)

Ignore
1481438144
Reply with quote  #2

1481438144
Report to moderator
1481438144
Hero Member
*
Offline Offline

Posts: 1481438144

View Profile Personal Message (Offline)

Ignore
1481438144
Reply with quote  #2

1481438144
Report to moderator
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 26, 2012, 05:52:21 AM
 #2

I'll add a 1 bitcoin reward for information leading to a working php => bitcoin rpc setup in windows 7 for me

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 26, 2012, 06:44:43 AM
 #3

http://jsonrpcphp.org/ use this and you can use any of the RPC command easily
Code:
<?php
require_once 'jsonRPCClient.php';
$myExample = new jsonRPCClient('http://<rpcusername>:<rpc password>@<bitcoind ip>:<bitocoind port>');
$myExample->getbalance();
?>

that simple it should work

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 26, 2012, 06:49:12 AM
 #4

I have it all set up, but it freezes after a few transactions, thats the part i need working

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 26, 2012, 06:51:17 AM
 #5

maybe you need more ram or update your bitcoind, have you tried send to many to cut down how many calls your making to the bitcoind?

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 26, 2012, 07:27:21 AM
 #6

bitcoind just crashes, bitcoin-qt freezes at 25% cpu use

Still freezes if i use sendmany

bitcoin uses under 100mb of ram at the point it freezes, over 3gb free


14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 26, 2012, 08:57:47 AM
 #7

This last run went for 60 rolls of the dice and then froze, it seems it freezes when bitcoin gets a new block at the same time as trying to send a transaction, and was actually using 150mb of ram, not under 100mb ... but still plenty free

is there a way to check for a block before trying to send a transaction?

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 26, 2012, 12:11:15 PM
 #8

This last run went for 60 rolls of the dice and then froze, it seems it freezes when bitcoin gets a new block at the same time as trying to send a transaction, and was actually using 150mb of ram, not under 100mb ... but still plenty free

is there a way to check for a block before trying to send a transaction?

what version did you try updating?

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 26, 2012, 03:05:27 PM
 #9

This last run went for 60 rolls of the dice and then froze, it seems it freezes when bitcoin gets a new block at the same time as trying to send a transaction, and was actually using 150mb of ram, not under 100mb ... but still plenty free

is there a way to check for a block before trying to send a transaction?

what version did you try updating?

i have 0.6.3 the latest on bitcoin.org, thats in the OP...

I'm really not sure its tied to new blocks any more, it seems to just randomly freeze on an api call

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 26, 2012, 06:25:42 PM
 #10

This last run went for 60 rolls of the dice and then froze, it seems it freezes when bitcoin gets a new block at the same time as trying to send a transaction, and was actually using 150mb of ram, not under 100mb ... but still plenty free

is there a way to check for a block before trying to send a transaction?

what version did you try updating?

i have 0.6.3 the latest on bitcoin.org, thats in the OP...

I'm really not sure its tied to new blocks any more, it seems to just randomly freeze on an api call

then that has to be a server issue cause, if it is on api calls then you maybe overloading it, idk that is weird

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
scribe
Sr. Member
****
Offline Offline

Activity: 295



View Profile WWW
July 29, 2012, 09:24:53 PM
 #11

Not one I can test here, but some ideas to try:

  • Sounds like some kind of race condition or lock condition maybe, possibly caused by too many things trying to access the same resource. The jsonRPCClient code doesn't seem to close it's stream neatly, but don't know if that would matter. You could try adding "fclose($fp);" inside jsonRPCClient.php, after the line "$response = json_decode($response,true);"
  • More extreme version of the above: Can you edit the script to destroy the jsonRPCClient object and construct a new one each loop? Might help to totally reset any open connections.
  • Can you isolate which RPC call is causing it by commenting out the sendtoaddress line? It might be the effect of many RPC calls, or one specific one.
  • Are you running the right bitcoind version for your PC, i.e. 32-bit vs 64-bit? Any improvement if you "downgrade" to 32-bit if you're running 64-bit?
  • Alternatively, is your PHP version up to date?
  • 25% is a weird number - are you running a quad core and maybe the bitcoind hits a CPU limit in one core?

blocknois.es Bitcoin music label. ~ New release: This Is Art

Read: Bitcoin Life | Wear: FUTUREECONOMY
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 30, 2012, 05:00:39 AM
 #12

It seems any RPC call (ATM machine... damnit) that tries while bitcoin is frozen fails (nothing to connect to)
not too sure it has anything to do with the blocks now, it freezes in between them too
I am on a quad core, PHP is up to date and Is there a 64 bit windows version?

  • Sounds like some kind of race condition or lock condition maybe, possibly caused by too many things trying to access the same resource. The jsonRPCClient code doesn't seem to close it's stream neatly, but don't know if that would matter. You could try adding "fclose($fp);" inside jsonRPCClient.php, after the line "$response = json_decode($response,true);"
  • More extreme version of the above: Can you edit the script to destroy the jsonRPCClient object and construct a new one each loop? Might help to totally reset any open connections.

I've pregenerated a few million keys in the keypool and its been running, when it freezes again I will try these....

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 30, 2012, 05:02:40 AM
 #13

It seems any RPC call (ATM machine... damnit) that tries while bitcoin is frozen fails (nothing to connect to)
not too sure it has anything to do with the blocks now, it freezes in between them too
I am on a quad core, PHP is up to date and Is there a 64 bit windows version?

  • Sounds like some kind of race condition or lock condition maybe, possibly caused by too many things trying to access the same resource. The jsonRPCClient code doesn't seem to close it's stream neatly, but don't know if that would matter. You could try adding "fclose($fp);" inside jsonRPCClient.php, after the line "$response = json_decode($response,true);"
  • More extreme version of the above: Can you edit the script to destroy the jsonRPCClient object and construct a new one each loop? Might help to totally reset any open connections.

I've pregenerated a few million keys in the keypool and its been running, when it freezes again I will try these....

there is your answer a few million keys in the keypool, is alot, i think a good number is 10,000 should be good

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 30, 2012, 05:18:22 AM
 #14

It seems any RPC call (ATM machine... damnit) that tries while bitcoin is frozen fails (nothing to connect to)
not too sure it has anything to do with the blocks now, it freezes in between them too
I am on a quad core, PHP is up to date and Is there a 64 bit windows version?

  • Sounds like some kind of race condition or lock condition maybe, possibly caused by too many things trying to access the same resource. The jsonRPCClient code doesn't seem to close it's stream neatly, but don't know if that would matter. You could try adding "fclose($fp);" inside jsonRPCClient.php, after the line "$response = json_decode($response,true);"
  • More extreme version of the above: Can you edit the script to destroy the jsonRPCClient object and construct a new one each loop? Might help to totally reset any open connections.

I've pregenerated a few million keys in the keypool and its been running, when it freezes again I will try these....

there is your answer a few million keys in the keypool, is alot, i think a good number is 10,000 should be good

... I'm not sure you are following along... I generated the millions of keys to try and stop it from freezing, the keypool is back on default now but i have millions of keys, so one less thing for the client to do that could cause a freeze by locking out rpc,  until i've used up the keys, but that should be a few days at least, and then i can try the suggestions from scribe and hope for the best

other things i have done that haven't worked
-Increased BdB cache to 1gb
-Increased/decreased number of connections
-A 30 second delay between RPC's

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
NRF
Member
**
Offline Offline

Activity: 105



View Profile
July 30, 2012, 05:20:39 AM
 #15

Try this;-

1. Shut everything down.

2. Disable your firewall.

3. Disable your Virus protection.

4. Go to User Account Control Settings and set it all the way to the bottom

5. Reboot (making sure that none of the above start automatically)

6. Start Bitcoind as administrator (right click on the Icon and "Run as administrator")

7. Start your process that invokes the PHP script (right click on the Icon and "Run as administrator")

8. See if it is fixed!!!

At that point, if it is not fixed restart all of the above and reboot.  If it is fixed work backwards up the list until it is broken again, then yell "Aha, that's the problem".  ;P
gweedo
Legendary
*
Offline Offline

Activity: 1246


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
July 30, 2012, 05:24:07 AM
 #16

It seems any RPC call (ATM machine... damnit) that tries while bitcoin is frozen fails (nothing to connect to)
not too sure it has anything to do with the blocks now, it freezes in between them too
I am on a quad core, PHP is up to date and Is there a 64 bit windows version?

  • Sounds like some kind of race condition or lock condition maybe, possibly caused by too many things trying to access the same resource. The jsonRPCClient code doesn't seem to close it's stream neatly, but don't know if that would matter. You could try adding "fclose($fp);" inside jsonRPCClient.php, after the line "$response = json_decode($response,true);"
  • More extreme version of the above: Can you edit the script to destroy the jsonRPCClient object and construct a new one each loop? Might help to totally reset any open connections.

I've pregenerated a few million keys in the keypool and its been running, when it freezes again I will try these....

there is your answer a few million keys in the keypool, is alot, i think a good number is 10,000 should be good

... I'm not sure you are following along... I generated the millions of keys to try and stop it from freezing, the keypool is back on default now but i have millions of keys, so one less thing for the client to do that could cause a freeze by locking out rpc,  until i've used up the keys, but that should be a few days at least, and then i can try the suggestions from scribe and hope for the best

other things i have done that haven't worked
-Increased BdB cache to 1gb
-Increased/decreased number of connections
-A 30 second delay between RPC's

ok but you still have a million address queued in your wallet, it has to go thru all those to load them into memory so yea, I would get more memory that will fix it, I think you don't have enough ram for a million keys

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 30, 2012, 09:35:12 AM
 #17

Nothing I've tried so far has fixed it, after scribes suggestion still resulted in the client freezing I tried a python version, it seemed to freeze quicker than php, however does seem to follow the rpc timeout rules so is still going, just very slowly instead of dying

I've tried the php version on two computers (both win7 64) and the python on one, i guess next step is trying either linux (not really the best option but i could make it work) or go through old versions of the client until one doesn't freeze (or crash)

unless there is something else I could try

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
NRF
Member
**
Offline Offline

Activity: 105



View Profile
July 30, 2012, 10:38:24 AM
 #18

Odd,

Assuming you did the shut off everything thing I suggested the next thing I would do is download the blockchain from scratch and a new wallet.

I use jsonRPCClient and jsonRPCServer classes alot and have never experienced the same issues.
drakahn
Hero Member
*****
Offline Offline

Activity: 504



View Profile
July 30, 2012, 11:15:12 AM
 #19

Odd,

Assuming you did the shut off everything thing I suggested the next thing I would do is download the blockchain from scratch and a new wallet.

I use jsonRPCClient and jsonRPCServer classes alot and have never experienced the same issues.

I've tried on a couple of computers, both as administrator, with and without firewalls, nothing else running, fresh install,  blockchain and wallet a few times on each

do you use 0.6.3 ?

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
scribe
Sr. Member
****
Offline Offline

Activity: 295



View Profile WWW
July 30, 2012, 11:18:38 AM
 #20

Did you try it with the "sendtoaddress" line of code commented out? Trying to work out if it's the RPC calls generally or creating the transactions that causes the problem...

blocknois.es Bitcoin music label. ~ New release: This Is Art

Read: Bitcoin Life | Wear: FUTUREECONOMY
Pages: [1] 2 3 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!