Limit monthly traffic per CT/VM

Discussion in 'Networking Questions' started by jmginer, Nov 28, 2016.

  1. jmginer

    jmginer Bit Poster

    Messages:
    3
    Hello, there is any option to limit the monthly traffic that a CT/VM can use?

    Then, if the limit is reached, suspend the service and reactivate the first day of the next month.

    This is a very useful option for hosting providers, as one of the main options when we sell a VPS is the monthly bandwidth limit.

    Thanks!
     
  2. Pavel

    Pavel A.I. Auto-Responder Odin Team

    Messages:
    403
    Hello,

    Virtuozzo allows you to limit bandwidth, see Traffic Shaping in User Guide: http://docs.virtuozzo.com/legacy/vz6/Virtuozzo_Users_Guide.pdf
    page 97

    However, automating traffic limitation is not possible through Virtuozzo itself - you need an automation solution for that, like OBAS/OSA or some custom solution which would monitor traffic utilization for you and trigger specific action when limit is surpassed.
     
  3. jmginer

    jmginer Bit Poster

    Messages:
    3
    Hi Pavel, the "Traffic Shaping" is for bandwidth limitation, that is to limit the network card of the CT/VM.
    What I'm asking for, is for a traffic limit, like: 5 TB/month, and without any traffic shaping configuration.

    For example, with traffic shaping we limit the network card of the CT/VM to 100 Mbps,
    with this limit and using the 100% of capacity the 100% of the time, the CT/VM can reach 33 TB/month of traffic usage.

    Current nodes and switches comes with 10Gbps network cards, and we want allow our customers to move data on this speed, that is without any traffic shaping config.
    The goal is to limit the monthly traffic limit, same as Plesk on hosting accounts.
     
  4. Pavel

    Pavel A.I. Auto-Responder Odin Team

    Messages:
    403
    You cannot limit the traffic without the shaping. It goes hand-in-hand.
    Once data transfer limit is hit you need to limit the transfer somehow. Either to remove the network interface entirely, or to enforce a very strict rule through the shaping - e.g. limit data trasnfer to 8 kbit/s :) There's also a firewall option, but it's a bit of an "alienated" solution towards the virtualization. Detaching the network interface is too harsh, some software might go wild, that is why I suggested enforcing very strict shaping - that's sort of a common approach.

    You can set up network classes through the shaping - it will also allow you to monitor traffic usage over the specific class. Usage can be extracted either from "vznetstat"(note, it displays traffic usage per network class, as in documentation I mentioned) or from PVA Agent (it also shows traffic per class, but its a bit tricky to extract, I'll explain steps if it's necessary).

    "Limit traffic" is a "policy" you want to apply. Virtualization platform itself never offers such things. Its a job for billing&automation platforms to monitor usage and restrict resources. If you're not using any automation solutions you'll probably have to automate this on your own.

    If you want to limit traffic then you should monitor traffic usage (vznetstat or statistics from PVA agent), once limit is hit you need to prevent further traffic over this network. That is one of the following: 1) detach network entirely 2) block connections through firewall 3) enforce a very strict shaper.
     

Share This Page