Skip to content

mtproxymax traffic #159

Closed
Closed

Description

@ralex52

Hello,
mtproxymax traffic
shows user traffic, but the
mtproxymax traffic reset-global
command doesn't reset these counters as expected.
Is there a working way to reset the counters so I can monitor daily resource consumption dynamics?
Thank you!

Activity

  1. rmtshnik commented on Oct 23, 2026

    @rmtshnik
    Contributor

    Traffic and quotas are cumulative by default. Use mtproxymax secret quota-reset for a recurring monthly quota period, or mtproxymax secret reset-traffic <label> to start a new period manually. mtproxymax traffic shows usage since each counter's most recent reset; its server-wide Total is independent from per-user resets.

    mtproxymax secret setlimits alice 100 5 10G 2026-12-31
    Copy code to clipboard
    mtproxymax secret setlimits alice 100 5 10G 2026-12-31

    mtproxymax traffic reset-global This command resets the total traffic for the entire proxy, but not for individual users.
    I have explained above how to reset the traffic for each user separately.

    mtproxymax secret reset-traffic <label>

  2. SamNet-dev commented on Oct 27, 2026

    @SamNet-dev
    Owner

    Hello @ralex52,

    Thank you for bringing this up!

    How Traffic Counters Work in MTProxyMax:

    • Server-wide Total Counter: Tracks cumulative traffic passing through the entire proxy server across all connections. Previously, mtproxymax traffic reset-global only reset this total server counter without touching individual user counters or quotas.
    • Per-User Traffic Counters: Track cumulative consumption per individual secret/user, which determines user quota limits.

    What We Added to Resolve This (Commit a5f5c3d):

    We have introduced dedicated commands under traffic to make resetting and monitoring daily dynamics straightforward:

    1. Reset both the server total and all user traffic in one command:

      mtproxymax traffic reset-all -y
    2. Reset only all per-user traffic counters:

      mtproxymax traffic reset-users
      # or: mtproxymax secret reset-traffic all
    3. Reset a single user's traffic counter:

      mtproxymax secret reset-traffic <label>

    Monitoring Daily Resource Consumption Dynamics:

    To automatically reset counters every midnight and track daily consumption, you can set up a daily cron job:

    0 0 * * * /opt/mtproxymax/mtproxymax traffic reset-all -y >/dev/null 2>&1

    Closing this issue as resolved. Please update your installation with mtproxymax update to receive these commands!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions