Editing
VPS Management
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Traffic accounting on linux == DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic. TODO: update for diff versions of vz Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us. You an see the current traffic stats by running `vznetstat`: <pre># vznetstat VEID Net.Class Output(bytes) Input(bytes) ----------------------------------------------- 24218 1 484M 39M 24245 1 463M 143M 2451 1 2224M 265M 2454 1 2616M 385M 4149 1 125M 68M 418 1 1560M 34M 472 1 1219M 315M 726 1 628M 317M 763 1 223M 82M 771 1 4234M 437M ----------------------------------------------- Total: 13780M 2090M</pre> As you can see the VEID is on a line with the in and out bytes. So, we simply run a cron job: 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system. Then it does it again for all the VEs in /vz1/private. It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive. You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically. Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.
Summary:
Please note that all contributions to JCWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JCWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information