Ich komm jetzt schon auf ~10GB pro Tag, was ich doch recht erstaunlich fand.
Eingestellt hab ich vorerst mal 40 maxconnections, die er bislang (also, in den 5 Tagen) aber nochnicht erreicht hat.
Kannst Du mal Deine Settings hier posten?
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
sudo apt-get install php5-curl
sudo service nginx restart
sudo service php5-fpm restart
sudo apt-get install php5-curl
sudo service nginx restart
sudo service php5-fpm restart
2016/07/08 17:54:55 [error] 23610#0: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to undefined function curl_init() in /hdd/www/includes/Bitcoin.php on line 68" while reading response header from upstream, client: 192.168.2.39, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.2.62"
nano ~/memory.sh
#!/bin/bash
# memory.sh - Memory usage stats
rrdtool=/usr/bin/rrdtool
db=/hdd/rrd/memory.rrd
# mempool-ram db added
mpdb=/hdd/rrd/mempool-ram.rrd
img=/hdd/www/html/images
if [ ! -e $db ]
then
$rrdtool create $db \
--step 300 \
DS:usage:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
# mempool db creation added
if [ ! -e $mpdb ]
then
$rrdtool create $mpdb \
--step 300 \
DS:mempoolmb:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
$rrdtool update $db -t usage N:`free -b |grep cache:|cut -d":" -f2|awk '{print $1}'`
# mempool db update added
n=`/usr/local/bin/bitcoin-cli getmempoolinfo | jq '.usage'`
$rrdtool update $mpdb -t mempoolmb N:"$n"
# mempool added to graph
for period in day week month year
do
$rrdtool graph $img/memory-$period.png -s -1$period \
-t "Memory usage last $period" -z \
-c "BACK#FFFFFF" -c "SHADEA#FFFFFF" -c "SHADEB#FFFFFF" \
-c "MGRID#AAAAAA" -c "GRID#CCCCCC" -c "ARROW#333333" \
-c "FONT#333333" -c "AXIS#333333" -c "FRAME#333333" \
-h 134 -w 543 -l 0 -a PNG -v "RAM" \
DEF:usage=$db:usage:AVERAGE \
DEF:mempoolmb=$mpdb:mempoolmb:AVERAGE \
VDEF:min=usage,MINIMUM \
VDEF:max=usage,MAXIMUM \
VDEF:avg=usage,AVERAGE \
VDEF:lst=usage,LAST \
VDEF:mpmin=mempoolmb,MINIMUM \
VDEF:mpmax=mempoolmb,MAXIMUM \
VDEF:mpavg=mempoolmb,AVERAGE \
VDEF:mplst=mempoolmb,LAST \
"COMMENT: \l" \
"COMMENT: " \
"COMMENT: " \
"COMMENT:Minimum " \
"COMMENT:Maximum " \
"COMMENT:Average " \
"COMMENT:Last \l" \
"COMMENT: " \
"AREA:usage#92CF00:Usage " \
"LINE1:usage#3F5A00" \
"GPRINT:min:%5.1lf %sB " \
"GPRINT:max:%5.1lf %sB " \
"GPRINT:avg:%5.1lf %sB " \
"GPRINT:lst:%5.1lf %sB \l" \
"COMMENT: " \
"AREA:mempoolmb#8AD3F1:Mempool " \
"LINE1:mempoolmb#49BEEF" \
"GPRINT:mpmin:%5.1lf %sB " \
"GPRINT:mpmax:%5.1lf %sB " \
"GPRINT:mpavg:%5.1lf %sB " \
"GPRINT:mplst:%5.1lf %sB \l" > /dev/null
done
sudo apt-get install jq
nano ~/mempool.sh
#!/bin/bash
# mempool.sh - Bitcoin mempool stats
rrdtool=/usr/bin/rrdtool
db=/hdd/rrd/mempool.rrd
img=/hdd/www/html/images
if [ ! -e $db ]
then
$rrdtool create $db \
--step 300 \
DS:mempool:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
#n=`/usr/local/bin/bitcoin-cli getrawmempool | jq length`
n=`/usr/local/bin/bitcoin-cli getmempoolinfo | jq '.size'`
$rrdtool update $db -t mempool N:"$n"
for period in day week month year
do
$rrdtool graph $img/mempool-$period.png -s -1$period \
-t "Mempool Tx last $period" -z \
-c "BACK#FFFFFF" -c "SHADEA#FFFFFF" -c "SHADEB#FFFFFF" \
-c "MGRID#AAAAAA" -c "GRID#CCCCCC" -c "ARROW#333333" \
-c "FONT#333333" -c "AXIS#333333" -c "FRAME#333333" \
-h 134 -w 543 -l 0 -a PNG -v "TX" \
DEF:mempool=$db:mempool:AVERAGE \
VDEF:max=mempool,MAXIMUM \
VDEF:avg=mempool,AVERAGE \
VDEF:lst=mempool,LAST \
"COMMENT: \l" \
"COMMENT: " \
"COMMENT: " \
"COMMENT:Last " \
"COMMENT:Average " \
"COMMENT:Maximum " \
"COMMENT: \l" \
"COMMENT: " \
"AREA:mempool#92CF00:Mempool Tx " \
"LINE1:mempool#3F5A00" \
"GPRINT:lst:%2.0lf " \
"GPRINT:avg:%2.0lf " \
"GPRINT:max:%2.0lf \l" > /dev/null
done
chmod +x ~/mempool.sh
mkdir /hdd/www/includes
nano /hdd/www/includes/Bitcoin.php
/*
The MIT License
Copyright (c) 2011 Schalk Bowerclass Bitcoin {
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Donations: 14bBEcMwwnDVXAYR8n2iTk9PTF5wqYLGR2
*/
// @var string
private $username;
// @var string
private $password;
// @var string
private $url;
// @var integer
private $id;
/**
* Contructor
*
* @param string $url
* @param string $username
* @param string $password
* @param boolean $debug
*/
public function __construct($url, $username, $password) {
//connection details
$this->url = $url;
$this->username = $username;
$this->password = $password;
//request id
$this->id = 1;
}
/**
* Perform jsonRCP request and return results as array
*
* @param string $method
* @param array $params
* @return array
*/
public function __call($method,$params) {
// make params indexed array of values
$params = array_values($params);
// prepares the request
$request = json_encode(array(
'method' => strtolower($method),
'params' => $params,
'id' => $this->id
));
// performs the HTTP POST using curl
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, Array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_URL, $this->url);
curl_setopt($curl, CURLOPT_USERPWD, $this->username.":".$this->password);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($curl);
curl_close($curl);
// process response
if (!$response) {
throw new Exception('Unable to connect to '.$this->url, 0);
}
$response = json_decode($response,true);
// check response id
if ($response['id'] != $this->id) {
throw new Exception('Incorrect response id (request id: '.$this->id.', response id: '.$response['id'].')',1);
}
if (!is_null($response['error'])) {
throw new Exception('Request error: '.print_r($response['error'],1),2);
}
$this->id++;
// return
return $response['result'];
}
}
?>
nano /hdd/www/html/index.php
include_once("/hdd/www/includes/Bitcoin.php");
# Daten zum Bitcoin Server
$rpcUser = "DEINBITCOINRPCUSER";
$rpcPass = "DEINBITCOINRPCPASS";
$url = "http://127.0.0.1:8332";
# Kontaktaufnahme
$bitcoin = new Bitcoin($url, $rpcUser, $rpcPass);
# antwortet Bitcoin?
try {
$info = $bitcoin->getinfo();
} catch (Exception $e) {
die($e->getMessage());
}
# dann sammeln wir Daten und bereiten sie etwas auf
$info = $bitcoin->getinfo();
$version = $info["version"];
$blocks = $info["blocks"];
$difficulty = floor($info["difficulty"]);
$connections = $info["connections"];
$version = (string)$version;
if($version[2] == "0")
{ $version[2] = ""; }
$version = "0.".$version[0].$version[1].".".$version[2].$version[3];
# und wenn wir alles zusammenhaben, bauen wir die Webseite zusammen
?>Bitcoin Full Node Statistics Bitcoin Full Node Statistics
Version echo $version; ?>
Blocks echo $blocks; ?>
Difficulty echo $difficulty; ?>
Connections echo $connections; ?>
Summary
Daily Traffic
Monthly Traffic
Top 10
nano ~/memory.sh
#!/bin/bash
# memory.sh - Memory usage stats
rrdtool=/usr/bin/rrdtool
db=/hdd/rrd/memory.rrd
img=/hdd/www/html/images
if [ ! -e $db ]
then
$rrdtool create $db \
--step 300 \
DS:usage:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
$rrdtool update $db -t usage N:`free -b |grep cache:|cut -d":" -f2|awk '{print $1}'`
for period in day week month year
do
$rrdtool graph $img/memory-$period.png -s -1$period \
-t "Memory usage last $period" -z \
-c "BACK#FFFFFF" -c "SHADEA#FFFFFF" -c "SHADEB#FFFFFF" \
-c "MGRID#AAAAAA" -c "GRID#CCCCCC" -c "ARROW#333333" \
-c "FONT#333333" -c "AXIS#333333" -c "FRAME#333333" \
-h 134 -w 543 -l 0 -a PNG -v "RAM" \
DEF:usage=$db:usage:AVERAGE \
VDEF:min=usage,MINIMUM \
VDEF:max=usage,MAXIMUM \
VDEF:avg=usage,AVERAGE \
VDEF:lst=usage,LAST \
"COMMENT: \l" \
"COMMENT: " \
"COMMENT: " \
"COMMENT:Minimum " \
"COMMENT:Maximum " \
"COMMENT:Average " \
"COMMENT:Current \l" \
"COMMENT: " \
"AREA:usage#92CF00:Usage " \
"LINE1:usage#3F5A00" \
"GPRINT:min:%5.1lf %sB " \
"GPRINT:max:%5.1lf %sB " \
"GPRINT:avg:%5.1lf %sB " \
"GPRINT:lst:%5.1lf %sB \l" > /dev/null
done
chmod +x ~/memory.sh
nano ~/network.sh
#!/bin/bash
# network.sh - Network usage stats
rrdtool=/usr/bin/rrdtool
db=/hdd/rrd/network.rrd
img=/hdd/www/html/images
if=eth0
if [ ! -e $db ]
then
$rrdtool create $db \
--step 300 \
DS:in:DERIVE:600:0:12500000 \
DS:out:DERIVE:600:0:12500000 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
$rrdtool update $db -t in:out N:`/sbin/ifconfig $if |grep bytes|cut -d":" -f2|cut -d" " -f1`:`/sbin/ifconfig $if |grep bytes|cut -d":" -f3|cut -d" " -f1`
for period in day week month year
do
$rrdtool graph $img/network-$period.png -s -1$period \
-t "eth0 traffic last $period" -z \
-c "BACK#FFFFFF" -c "SHADEA#FFFFFF" -c "SHADEB#FFFFFF" \
-c "MGRID#AAAAAA" -c "GRID#CCCCCC" -c "ARROW#333333" \
-c "FONT#333333" -c "AXIS#333333" -c "FRAME#333333" \
-h 134 -w 543 -l 0 -a PNG -v "B/s" \
DEF:in=$db:in:AVERAGE \
DEF:out=$db:out:AVERAGE \
VDEF:minin=in,MINIMUM \
VDEF:minout=out,MINIMUM \
VDEF:maxin=in,MAXIMUM \
VDEF:maxout=out,MAXIMUM \
VDEF:avgin=in,AVERAGE \
VDEF:avgout=out,AVERAGE \
VDEF:lstin=in,LAST \
VDEF:lstout=out,LAST \
VDEF:totin=in,TOTAL \
VDEF:totout=out,TOTAL \
"COMMENT: \l" \
"COMMENT: " \
"COMMENT:Minimum " \
"COMMENT:Maximum " \
"COMMENT:Average " \
"COMMENT:Current " \
"COMMENT:Total \l" \
"COMMENT: " \
"AREA:out#92CF00:Out " \
"LINE1:out#3F5A00" \
"GPRINT:minout:%5.1lf %sB/s " \
"GPRINT:maxout:%5.1lf %sB/s " \
"GPRINT:avgout:%5.1lf %sB/s " \
"GPRINT:lstout:%5.1lf %sB/s " \
"GPRINT:totout:%5.1lf %sB \l" \
"COMMENT: " \
"AREA:in#8AD3F1:In " \
"LINE1:in#49BEEF" \
"GPRINT:minin:%5.1lf %sB/s " \
"GPRINT:maxin:%5.1lf %sB/s " \
"GPRINT:avgin:%5.1lf %sB/s " \
"GPRINT:lstin:%5.1lf %sB/s " \
"GPRINT:totin:%5.1lf %sB \l" > /dev/null
done
chmod +x ~/network.sh
nano ~/cpuload.sh
#!/bin/bash
# cpuload.sh - CPU Load stats
rrdtool=/usr/bin/rrdtool
db=/hdd/rrd/cpuload.rrd
img=/hdd/www/html/images
if [ ! -e $db ]
then
$rrdtool create $db \
--step 300 \
DS:load1:GAUGE:600:0:U \
DS:load5:GAUGE:600:0:U \
DS:load15:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
uptime=`uptime`
base="${uptime##*:}"
input="$(echo -e "${base}" | tr -d '[[:space:]]')"
load1=$(echo $input | cut -d',' -f1-2 | tr ',' '.')
load5=$(echo $input | cut -d',' -f3-4 | tr ',' '.')
load15=$(echo $input | cut -d',' -f5-6 | tr ',' '.')
$rrdtool update $db -t load1:load5:load15 N:$load1:$load5:$load15
for period in day week month year
do
$rrdtool graph $img/cpuload-$period.png -s -1$period \
-t "CPU Load last $period" -z \
-c "BACK#FFFFFF" -c "SHADEA#FFFFFF" -c "SHADEB#FFFFFF" \
-c "MGRID#AAAAAA" -c "GRID#CCCCCC" -c "ARROW#333333" \
-c "FONT#333333" -c "AXIS#333333" -c "FRAME#333333" \
-h 134 -w 543 -l 0 -a PNG -v "CPU" \
DEF:load1=$db:load1:AVERAGE \
DEF:load5=$db:load5:AVERAGE \
DEF:load15=$db:load15:AVERAGE \
VDEF:lst1=load1,LAST \
VDEF:lst5=load5,LAST \
VDEF:lst15=load15,LAST \
VDEF:avg1=load1,AVERAGE \
VDEF:avg5=load5,AVERAGE \
VDEF:avg15=load15,AVERAGE \
VDEF:max1=load1,MAXIMUM \
VDEF:max5=load5,MAXIMUM \
VDEF:max15=load15,MAXIMUM \
"COMMENT: " \
"COMMENT: " \
"COMMENT: " \
"COMMENT:Last " \
"COMMENT:Average " \
"COMMENT:Maximum \l" \
"COMMENT: " \
"COMMENT: " \
"AREA:load1#92CF00:1m " \
"GPRINT:lst1: %1.2lf " \
"GPRINT:avg1: %1.2lf " \
"GPRINT:max1: %1.2lf \l" \
"COMMENT: " \
"COMMENT: " \
"LINE3:load5#49BEEF88:5m " \
"GPRINT:lst5: %1.2lf " \
"GPRINT:avg5: %1.2lf " \
"GPRINT:max5: %1.2lf \l" \
"COMMENT: " \
"COMMENT: " \
"LINE2:load15#C3E9FA:15m " \
"GPRINT:lst15: %1.2lf " \
"GPRINT:avg15: %1.2lf " \
"GPRINT:max15: %1.2lf \l" > /dev/null
done
chmod +x ~/cpuload.sh
crontab -e
*/5 * * * * nice /home/pi/memory.sh >/dev/null 2>&1
*/5 * * * * nice /home/pi/network.sh >/dev/null 2>&1
*/5 * * * * nice /home/pi/cpuload.sh >/dev/null 2>&1
sudo apt-get install vnstat vnstati php5-gd
mkdir /hdd/www/html/images
nano ~/vnstati.sh
#!/bin/bash
# vnstati.sh - network stats creation script
vnstati -vs -ne -nh -i eth0 -o /hdd/www/html/images/summary.png -ru 0
vnstati -d -ne -nh -i eth0 -o /hdd/www/html/images/daily.png -ru 0
vnstati -m -ne -nh -i eth0 -o /hdd/www/html/images/monthly.png -ru 0
vnstati -t -ne -nh -i eth0 -o /hdd/www/html/images/top10.png -ru 0
chmod +x ~/vnstati.sh
crontab -e
# updating every 5 minutes
*/5 * * * * nice /home/pi/vnstati.sh >/dev/null 2>&1
sudo apt-get install rrdtool
mkdir /hdd/rrd
nano ~/connections.sh
#!/bin/bash
# connections.sh - Bitcoin connection stats
rrdtool=/usr/bin/rrdtool
db=/hdd/rrd/connections.rrd
img=/hdd/www/html/images
if [ ! -e $db ]
then
$rrdtool create $db \
--step 300 \
DS:connections:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480
fi
n=`/usr/local/bin/bitcoin-cli getconnectioncount`
$rrdtool update $db -t connections N:"$n"
for period in day week month year
do
$rrdtool graph $img/connections-$period.png -s -1$period \
-t "Connections last $period" -z \
-c "BACK#FFFFFF" -c "SHADEA#FFFFFF" -c "SHADEB#FFFFFF" \
-c "MGRID#AAAAAA" -c "GRID#CCCCCC" -c "ARROW#333333" \
-c "FONT#333333" -c "AXIS#333333" -c "FRAME#333333" \
-h 134 -w 543 -l 0 -a PNG -v "#" \
DEF:connections=$db:connections:AVERAGE \
VDEF:max=connections,MAXIMUM \
VDEF:avg=connections,AVERAGE \
VDEF:lst=connections,LAST \
"COMMENT: \l" \
"COMMENT: " \
"COMMENT: " \
"COMMENT:Last " \
"COMMENT:Average " \
"COMMENT:Maximum " \
"COMMENT: \l" \
"COMMENT: " \
"AREA:connections#92CF00:Connections " \
"LINE1:connections#3F5A00" \
"GPRINT:lst:%2.0lf " \
"GPRINT:avg:%2.0lf " \
"GPRINT:max:%2.0lf \l" > /dev/null
done
chmod +x ~/connections.sh
crontab -e
# updating every 5 minutes
*/5 * * * * nice /home/pi/connections.sh >/dev/null 2>&1