GoAdmio

compare

Compare how web requests are split across multiple GoAdmio servers

On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · See also


Overview

/go/compare asks each GoAdmio server you list how many requests it has served, adds the numbers together, and prints each server's percentage of the total. Use it to see whether traffic is spread evenly across servers, for example behind a load balancer or DNS round-robin.

Only request counts are compared. The command doesn't report CPU, memory, or disk usage.


Quick start

# Compare two servers
/go/compare 203.0.113.10 203.0.113.11

Syntax

/go/compare <server> [<server> ...]

Arguments

Argument Required Notes
<server> Yes, at least one The IP address or hostname of a GoAdmio server. Don't include a port or http://.

Each argument is queried in turn, in the order given.


Output

One line per server that answered, in the same order you listed them, showing the address and its share of the total requests with one decimal place:

203.0.113.10 42.3%
203.0.113.11 57.7%
Situation What you see
All servers answered A percentage line for each server.
Some servers didn't answer Percentages for the servers that did. The others are left out without any message.
No server answered Nothing is printed and the command exits with status 1.
Every server reports 0 requests An awk division-by-zero error.

The percentages are rounded, so they may not add up to exactly 100.0%. Absolute request counts aren't shown.

Every run is logged with its arguments and a timestamp, for example [Nov 20 09:15:02]# compare 203.0.113.10 203.0.113.11, to /var/log/go/compare.log.


Examples

# Compare three servers
/go/compare 203.0.113.10 203.0.113.11 203.0.113.12
# Compare servers by hostname
/go/compare web1.example.com web2.example.com
# Check what a single server reports
wget -qO- "http://203.0.113.10:2020/file.php?Action=Requests"

Troubleshooting

Symptom Likely cause Fix
No output at all No argument was given, or no server returned a number. Pass at least one address, and test each server with the wget command in Examples.
A server is missing from the list It didn't answer within 10 seconds, or didn't return a whole number. Check that the server is online and that port 2020 is reachable from this server. No error is shown for a skipped server.
awk: division by zero attempted All servers reported 0 requests. Run it again once the servers have received traffic.
The numbers look wrong A leftover /etc/compare file from an interrupted run is being included. Delete /etc/compare and run again.
Percentages don't add up to 100.0% Each value is rounded. Normal.
A server with a port in its address fails The command adds port 2020 itself. Pass only the address, without a port.
The command takes a long time Servers are queried one at a time, and each unreachable server waits up to 10 seconds. Remove unreachable servers from the list.

Details

How it works

  1. For each address, requests http://<server>:2020/file.php?Action=Requests once, with a 10-second timeout. Port 2020 is the GoAdmio panel port.
  2. If the reply is a whole number, appends <server> <number> to the temporary file /etc/compare.
  3. If no server answered, exits with status 1.
  4. Adds up all the numbers and prints each server's percentage of the total.
  5. Deletes /etc/compare.

What the request count covers (for example, which period) is defined by the GoAdmio panel on each server. The command only reads the number it returns.

Requirements

Notes


See also

Command Description
visits Check daily visits and estimate capacity
uptime Monitor multiple server IPs for uptime/downtime
loadavg Check the weekly server load average
memoryavg Check the weekly server memory average
allow Open a port in your server's firewall