Bitcoin Forum
March 19, 2024, 03:08:56 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [22] 23 24 25 26 27 28 29 »
  Print  
Author Topic: Pushpool - Tech Support  (Read 135135 times)
Flowz
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
August 05, 2011, 08:46:39 AM
 #421

Hi, please help me.
I will pay you 5BTC for the solution.

pushpool 5.1 stops working after some hours .
When i look atr the terminalscreen i see "too many open files".

pushpoold is still running , but does not accepting any connections.

cat /proc/sys/fs/files-max are 400000. Think thats enough.

The system:

Dedicated Server
Open Suse 11.4 x64
32GB RAM

I want tu run my pool 24/7 without watching the pushpool status all the time.

Try these commands:
Code:
# ulimit -n40000
# cd /etc/security/
# nano limits.conf

This will open a file in Nano. Now, use PAGE DOWN, or the DOWN ARROW until you get to the very bottom of this confusing document. Once there, add the following lines:

Code:
soft nofile 40000
hard nofile 40000

Press CTRL+O (save), and then CTRL+X (exit). Ok, now type:
Code:
# cd /usr/include/bits/
# nano typesizes.h

now start to look for the line: #define __FD_SETSIZE 1024 so change that to #define __FD_SETSIZE 40000

If you don't have nano installed:
Code:
CentOS:
# yum install nano

Others:
# apt-get install nano
1710817736
Hero Member
*
Offline Offline

Posts: 1710817736

View Profile Personal Message (Offline)

Ignore
1710817736
Reply with quote  #2

1710817736
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1710817736
Hero Member
*
Offline Offline

Posts: 1710817736

View Profile Personal Message (Offline)

Ignore
1710817736
Reply with quote  #2

1710817736
Report to moderator
1710817736
Hero Member
*
Offline Offline

Posts: 1710817736

View Profile Personal Message (Offline)

Ignore
1710817736
Reply with quote  #2

1710817736
Report to moderator
1710817736
Hero Member
*
Offline Offline

Posts: 1710817736

View Profile Personal Message (Offline)

Ignore
1710817736
Reply with quote  #2

1710817736
Report to moderator
sareea
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
August 05, 2011, 08:50:31 AM
 #422

Post your server.json file. The problem is there.
here is it,
http://pastebin.com/aL9Am2Pf
i checked it with
http://jsonformatter.curiousconcept.com/
and it is valid
thanks!
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 05, 2011, 01:44:38 PM
 #423

Hi, please help me.
I will pay you 5BTC for the solution.

pushpool 5.1 stops working after some hours .
When i look atr the terminalscreen i see "too many open files".

pushpoold is still running , but does not accepting any connections.

cat /proc/sys/fs/files-max are 400000. Think thats enough.

The system:

Dedicated Server
Open Suse 11.4 x64
32GB RAM

I want tu run my pool 24/7 without watching the pushpool status all the time.


You have long polling enabled, don't you?  And you have blkmond running?

Yeah, blkmond is not all that reliable.  The issue is that your connections to bitcoind are staying open even after a new block is discovered, instead of the connections being flushed and closed.

You can increase the ulimit but you'll still run into it eventually.  The standing solution seems to be that most operators simply restart pushpoold once in awhile.

I prefer a more permanent solution, which is JoelKatz' patch to bitcoind, here:

http://davids.webmaster.com/~davids/bitcoin-4diff.txt

For a full 12+ page discussion of the issue and its resolution (which ultimately ends up being the forgoing diff), see here:

https://bitcointalk.org/index.php?topic=22585.0

For instance, my files-max is at 262,000 and change.  Even at high load with the above patch, the TIME_WAIT connection count remains very low.
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 05, 2011, 01:52:10 PM
 #424

Post your server.json file. The problem is there.
here is it,
http://pastebin.com/aL9Am2Pf
i checked it with
http://jsonformatter.curiousconcept.com/
and it is valid
thanks!

What the piece of C code you posted means, in words, is: "If the newline character is not found in the string, within the length of the line buffer, the line is too long".

My guess is you've got your newlines in the file switched to DOS newlines. VIM won't reveal this because it properly understands both newline formats (although, depending on your flavor, it may warn you about it and give you a chance to fix it. It does this on CentOS, I am not sure about other variants).

Try the following command:

Code:
dos2unix -n server.json serverFixed.json

and then try to use the new serverFixed.json file as your pushpoold config file. Post results.

If you don't have the dos2unix utility, you can install it either via
Code:
apt-get install tofrodos
or
Code:
yum install dos2unix
depending on your Linux OS flavor.
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 05, 2011, 01:57:22 PM
 #425

I am not sure if I got blkmon running correctly on my pool at nmcbit.com
I would run it and it would connect and disconnect like this...

Code:
Connecting
connected
close
close

I looked at the source code and I looks like its looking to see if a new block is found and killing the pushpoold I jjust did not find where it starts it up again.  Anyhow I switch the port that was set in blkmond.conf file to the RPC port and it stayed connected but it's not doing anything.

My problem is pushpoold stops working a while after it finds a block.

Can anyone help?

blkmond doesn't kill pushpool and restart it; it sends the USR1 signal to pushpool.  It's a thin shim over the blockcount method in bitcoind.  When blkmond sees that the count has incremented, it sends the aforementioned signal.  When pushpool receives this signal, it flushes and closes all of its LP waiters - e.g. socket connections - to bitcoind. 

Problem is, blkmond is not reliable and tends to simply... stop... after awhile and either needs to be restarted, or pushpool needs to be restarted to close the sockets.

See my reply, 2 posts above, about the real solution to this problem, which eliminates the need for blkmond.  If you're not comfortable patching your bitcoin, you can simply do as others do which is restart blkmond and/or pushpool periodically.
sareea
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
August 05, 2011, 02:51:46 PM
 #426

Post your server.json file. The problem is there.
here is it,
http://pastebin.com/aL9Am2Pf
i checked it with
http://jsonformatter.curiousconcept.com/
and it is valid
thanks!

What the piece of C code you posted means, in words, is: "If the newline character is not found in the string, within the length of the line buffer, the line is too long".

My guess is you've got your newlines in the file switched to DOS newlines. VIM won't reveal this because it properly understands both newline formats (although, depending on your flavor, it may warn you about it and give you a chance to fix it. It does this on CentOS, I am not sure about other variants).

Try the following command:

Code:
dos2unix -n server.json serverFixed.json

and then try to use the new serverFixed.json file as your pushpoold config file. Post results.

If you don't have the dos2unix utility, you can install it either via
Code:
apt-get install tofrodos
or
Code:
yum install dos2unix
depending on your Linux OS flavor.
Thanks mate !
I did this:
sudo apt-get install dos2unix ( the code you gave was already installed and the dos2unix command wasn't recognizable )

i ran the command : dos2unix -n server.json serverFixed.json

renamed serverFixed.json to server.json

and then i tried these:
Code:
root@server:/pool# ./pushpoold -E -F --config=/pool/server.json
[2011-08-05 14:48:16.191748] /pool/server.json: JSON parse failed


Code:
root@server:/pool# ./pushpoold -E -F --config=server.json
[2011-08-05 14:48:41.989500] config file(server.json) line too long

Code:
root@server:/pool# ./pushpoold --config=/pool/server.json -E -F
[2011-08-05 14:46:26.202941] /pool/server.json: JSON parse failed

Code:
root@server:/pool# ./pushpoold -E
[2011-08-05 14:47:49.851618] server.json: JSON parse failed

It didn't work :S what do you think ?
Thanks !
DavinciJ15
Hero Member
*****
Offline Offline

Activity: 780
Merit: 510


Bitcoin - helping to end bankster enslavement.


View Profile WWW
August 05, 2011, 03:53:07 PM
 #427

I am not sure if I got blkmon running correctly on my pool at nmcbit.com
I would run it and it would connect and disconnect like this...

Code:
Connecting
connected
close
close

I looked at the source code and I looks like its looking to see if a new block is found and killing the pushpoold I jjust did not find where it starts it up again.  Anyhow I switch the port that was set in blkmond.conf file to the RPC port and it stayed connected but it's not doing anything.

My problem is pushpoold stops working a while after it finds a block.

Can anyone help?

blkmond doesn't kill pushpool and restart it; it sends the USR1 signal to pushpool.  It's a thin shim over the blockcount method in bitcoind.  When blkmond sees that the count has incremented, it sends the aforementioned signal.  When pushpool receives this signal, it flushes and closes all of its LP waiters - e.g. socket connections - to bitcoind. 

Problem is, blkmond is not reliable and tends to simply... stop... after awhile and either needs to be restarted, or pushpool needs to be restarted to close the sockets.

See my reply, 2 posts above, about the real solution to this problem, which eliminates the need for blkmond.  If you're not comfortable patching your bitcoin, you can simply do as others do which is restart blkmond and/or pushpool periodically.

Thanks!
You're a gentleman and a scholar!
Keep up the good work.

Davinci
Vadtec
Newbie
*
Offline Offline

Activity: 15
Merit: 0


View Profile
August 05, 2011, 04:01:01 PM
 #428

I think you are confused, the only thing rewrite does is have everyone hash at the current bitcoin network difficulty making the whole set up useless scince no work/shares will be distributed unless someone finds a block then only one share will be sent to the database.

Thanks for the response. And yes, I'm not sure what it's doing. So, questions:

1) When I set it to true in the config file, I get entries in the DB. When I set it to false, I do not. Which mode is correct for running a pool? I am assuming setting it to true is what I want to do, because otherwise I do not get any entries in the db.

2) If I set it to false, will I only see entries in the DB when a block is found?

3) (Unrelated to the rewrite setting.) I am trying to query the hash rate of the pushpoold, so that I know how many hash/sec it's handling. When I try (on a *nix host) bitcoind gethashespersec, all I see is 0. pushpoold and bitcoind are running on the same host in this case. What is the correct way to find out how many hash/sec is being handled by pushpoold?

- Vadtec

So hard to get simple responses to simple questions.   Roll Eyes

- Vadtec
btcpool24
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 05, 2011, 05:37:31 PM
 #429

Hi, please help me.
I will pay you 5BTC for the solution.

pushpool 5.1 stops working after some hours .
When i look atr the terminalscreen i see "too many open files".

pushpoold is still running , but does not accepting any connections.

cat /proc/sys/fs/files-max are 400000. Think thats enough.

The system:

Dedicated Server
Open Suse 11.4 x64
32GB RAM

I want tu run my pool 24/7 without watching the pushpool status all the time.


You have long polling enabled, don't you?  And you have blkmond running?

Yeah, blkmond is not all that reliable.  The issue is that your connections to bitcoind are staying open even after a new block is discovered, instead of the connections being flushed and closed.

You can increase the ulimit but you'll still run into it eventually.  The standing solution seems to be that most operators simply restart pushpoold once in awhile.

I prefer a more permanent solution, which is JoelKatz' patch to bitcoind, here:

http://davids.webmaster.com/~davids/bitcoin-4diff.txt

For a full 12+ page discussion of the issue and its resolution (which ultimately ends up being the forgoing diff), see here:

https://bitcointalk.org/index.php?topic=22585.0

For instance, my files-max is at 262,000 and change.  Even at high load with the above patch, the TIME_WAIT connection count remains very low.


Thanky you for the answer. I put blkmon to dev/null  a long time ago. I allready use this bitcoin patch.
Must i restart the server or any services if i change ulimit and or soft/hard limit din /etc/security... ?
Flowz
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
August 05, 2011, 06:28:09 PM
 #430

Post your server.json file. The problem is there.
here is it,
http://pastebin.com/aL9Am2Pf
i checked it with
http://jsonformatter.curiousconcept.com/
and it is valid
thanks!

What the piece of C code you posted means, in words, is: "If the newline character is not found in the string, within the length of the line buffer, the line is too long".

My guess is you've got your newlines in the file switched to DOS newlines. VIM won't reveal this because it properly understands both newline formats (although, depending on your flavor, it may warn you about it and give you a chance to fix it. It does this on CentOS, I am not sure about other variants).

Try the following command:

Code:
dos2unix -n server.json serverFixed.json

and then try to use the new serverFixed.json file as your pushpoold config file. Post results.

If you don't have the dos2unix utility, you can install it either via
Code:
apt-get install tofrodos
or
Code:
yum install dos2unix
depending on your Linux OS flavor.
There is a much easier way of doing it..
Code:
# vim server.json
# :set fileformat=unix
# :x!
Done!
sareea
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
August 05, 2011, 08:28:04 PM
Last edit: August 05, 2011, 10:03:30 PM by sareea
 #431

Thanks Furyan and Flowz !!!
Furyan your explanation helped me thousand times ! thanks . Even though the command didn't help, but i think it ruined the file , or i dunno .
I did this , made a text file in directadmin file manager and named it server.json and moved it to the pool directory, and it reads it ! Wow .
Nice .

I am only afraid of that the file permissions are for admin as seen in the directadmin file manager and not for root ...

Edit : I get this error in my directadmin

Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I think my Mysql server is down , once i started pushpoold this what happened . And now it can't connect to the SQL server.
strange ... what should i do ? I try to stop mysqld but it fails ...
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 06, 2011, 01:42:06 AM
 #432

-snip me-
There is a much easier way of doing it..
Code:
# vim server.json
# :set fileformat=unix
# :x!
Done!

The vim-foo is strong in this one! Learn something new every day, thanks Smiley
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 06, 2011, 01:44:31 AM
 #433


Thanky you for the answer. I put blkmon to dev/null  a long time ago. I allready use this bitcoin patch.
Must i restart the server or any services if i change ulimit and or soft/hard limit din /etc/security... ?


I am 98.7% sure the answer to that is yes.  I'm not intimately familiar with the functioning of that value but I don't think changes to it will get picked up by a running process.
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 06, 2011, 01:52:17 AM
Last edit: August 06, 2011, 02:07:31 AM by Furyan
 #434


Thanks for the response. And yes, I'm not sure what it's doing. So, questions:

1) When I set it to true in the config file, I get entries in the DB. When I set it to false, I do not. Which mode is correct for running a pool? I am assuming setting it to true is what I want to do, because otherwise I do not get any entries in the db.

2) If I set it to false, will I only see entries in the DB when a block is found?

3) (Unrelated to the rewrite setting.) I am trying to query the hash rate of the pushpoold, so that I know how many hash/sec it's handling. When I try (on a *nix host) bitcoind gethashespersec, all I see is 0. pushpoold and bitcoind are running on the same host in this case. What is the correct way to find out how many hash/sec is being handled by pushpoold?

- Vadtec

So hard to get simple responses to simple questions.   Roll Eyes

- Vadtec

Sorry, missed this one. We're multi-threading a single thread. Hah! Smiley

1. Correct mode = up to you. Strictly speaking there's no need to record the failed shares. They are useful for paying out for pool participation, though Smiley In which case the correct mode = true.
2. Yes
3. I've made the same observation. Even when I know the load is sufficient to produce a value, "gethashespersec" always returns 0.  Must be a bug in bitcoin, but one I haven't bothered to track down. The solution I've seen to this exists within the MiningFarm and SimpleCoin pool frontends - essentially they make the following calculation:

* Count all current shares (or shares over a selected time range)
* hashrate = round(((NUMSHARES*4294967296)/600)/1000000, 0);

The magic numbers are:

4294967296 = hashes/share.  When multiplied by shares, gives you a total count of hashes. I'm assuming this magic number is correct; I haven't personally verified it.
600 = seconds in 10 minutes. You'd change this according to your time window. The division here gives you "hashes/sec".
1000000 = hashes/sec to Mhash/s.   Technically I think that number should be 1048576 (1024^2) to fit the strict definition of "mega", but I wouldn't be a stickler about it.  And it would deflate the apparent hash rate.
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 06, 2011, 02:00:10 AM
 #435

Thanks Furyan and Flowz !!!
Furyan your explanation helped me thousand times ! thanks . Even though the command didn't help, but i think it ruined the file , or i dunno .
I did this , made a text file in directadmin file manager and named it server.json and moved it to the pool directory, and it reads it ! Wow .
Nice .

I am only afraid of that the file permissions are for admin as seen in the directadmin file manager and not for root ...

Edit : I get this error in my directadmin

Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I think my Mysql server is down , once i started pushpoold this what happened . And now it can't connect to the SQL server.
strange ... what should i do ? I try to stop mysqld but it fails ...

Glad to help...

So, it's probably a bad idea to run pushpool as root.  Run pushpool as the same user as the owner of the server.json file.

I'm not sure about that mysql error.  It's supposed to run as the system account so I don't think it's a permissions problem.  It's probably dead but the PID file is still around.

What happens if you do

Code:
service mysqld stop
wait about 30 seconds
Code:
service mysqld start

Do NOT use "service mysqld restart".  Seems to be an odd problem with removal of the locking file.  I've had the same happen on my own server, restart doesn't work, you have to use stop and then start (even though restart does exactly the same thing, it's the timing of how close together the calls are).
jgarzik
Legendary
*
Offline Offline

Activity: 1596
Merit: 1091


View Profile
August 06, 2011, 05:01:35 AM
 #436

'gethashespersec' and getinfo's 'hashespersec' are only for the internal, largely unused CPU miner inside bitcoind.

You must use submitted shares to calculate that.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
sareea
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
August 06, 2011, 07:46:13 AM
 #437

Thanks Furyan and Flowz !!!
Furyan your explanation helped me thousand times ! thanks . Even though the command didn't help, but i think it ruined the file , or i dunno .
I did this , made a text file in directadmin file manager and named it server.json and moved it to the pool directory, and it reads it ! Wow .
Nice .

I am only afraid of that the file permissions are for admin as seen in the directadmin file manager and not for root ...

Edit : I get this error in my directadmin

Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I think my Mysql server is down , once i started pushpoold this what happened . And now it can't connect to the SQL server.
strange ... what should i do ? I try to stop mysqld but it fails ...

Glad to help...

So, it's probably a bad idea to run pushpool as root.  Run pushpool as the same user as the owner of the server.json file.

I'm not sure about that mysql error.  It's supposed to run as the system account so I don't think it's a permissions problem.  It's probably dead but the PID file is still around.

What happens if you do

Code:
service mysqld stop
wait about 30 seconds
Code:
service mysqld start

Do NOT use "service mysqld restart".  Seems to be an odd problem with removal of the locking file.  I've had the same happen on my own server, restart doesn't work, you have to use stop and then start (even though restart does exactly the same thing, it's the timing of how close together the calls are).


Look what it gives :S
Code:
root@server:/tmp# service mysqld stop
Stopping mysqld:                [ FAILED ]
root@server:/tmp# service mysqld start
Starting mysqld:                [ OK ]
root@server:/tmp# ps xa | grep mysqld
23794 ?        S      0:00 sh -c /etc/init.d/mysqld rest
art                           >>/dev/null 2>>/dev/null

23795 ?        S      0:00 /bin/sh /etc/init.d/mysqld re
start
23865 ttyp0    S+     0:00 grep mysqld
root@server:/tmp# cd /var/run/mysql/
-bash: cd: [b]/var/run/mysql/: No such file or directory[/b]
I think something deleted this whole directory ? or is it located somewhere else ?
And when i start mysqld using directadmin it automatically shuts down :S I will google this to ease the pain hh
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
August 06, 2011, 09:09:47 AM
 #438

yea,

cd /var/run/mysql/
-bash: cd: /var/run/mysql/: No such file or directory

that's what I get.  It's correct, too.

you mean to:

cd: /var/run/

then

ls mys*

if it's running you should see:

mysqld.pid

or you could avoid the whole cd thing and just type:


ls /var/run/my*


sareea
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
August 06, 2011, 09:15:43 AM
 #439

yea,

cd /var/run/mysql/
-bash: cd: /var/run/mysql/: No such file or directory

that's what I get.  It's correct, too.

you mean to:

cd: /var/run/

then

ls mys*

if it's running you should see:

mysqld.pid

or you could avoid the whole cd thing and just type:


ls /var/run/my*




This is what i see,
Code:
root@server:/delete# cd /var/run/
root@server:/var/run# ls mys*
root@server:/var/run# ls mys
ls: cannot access mys: No such file or directory
root@server:/var/run# ls mys*
root@server:/var/run# ls /var/run/my*
root@server:/var/run#

I checked in Directadmin and it says that MySQL 5.5.9 is not running , i am trying the running commands , but nothing is available, something deleted it , i am trying to reinstall ...
What do you think ?
Thanks
Furyan
Full Member
***
Offline Offline

Activity: 175
Merit: 100



View Profile
August 06, 2011, 10:05:59 AM
 #440

'gethashespersec' and getinfo's 'hashespersec' are only for the internal, largely unused CPU miner inside bitcoind.

You must use submitted shares to calculate that.



Ah makes perfect sense, thanks.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [22] 23 24 25 26 27 28 29 »
  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!