Git Product home page Git Product logo

varnishgather's People

Contributors

andrewwiik avatar aondio avatar asadsa92 avatar daghf avatar dridi avatar espebra avatar fgsch avatar freshteapot avatar gquintard avatar guardalben avatar hermunn avatar hugocruz avatar ismaelpuerto avatar kristianlyng avatar lallassu avatar mariusmagureanu avatar mbgrydeland avatar quiver avatar rezan avatar simonvik avatar simook avatar stevendore avatar stone avatar tfheen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

varnishgather's Issues

proc/PID/maps

linux has a limit on the number of concurrent memory mappings. (64k)

include the number of memory maps used by varnishd in the report.

Something like:
root@varnish:/# for i in pidof varnishd; do wc -l /proc/$i/maps; done

might even grep for readwrite mappings, to avoid the binaries/shared ones.

Also capture cgroup values

/proc/$$/limits doesn't list cgroup limits, we might want to capture contents in cgroup sysfs (/sys/fs/cgroup) as well.

Favor ss over netstat

That is when both are available. netstat will choke on systems with too many open connections.

Python version crashes

lkarsten@immer:/work/varnishgather$ python ./varnishgather.py
Running date
Running dmesg
Running free -m
Running lsb_release -a
Running varnishstat -V
Running sysctl -a
Traceback (most recent call last):
File "./varnishgather.py", line 142, in
LoggedCommand(cmd)(tar)
File "./varnishgather.py", line 100, in call
self.run()
File "./varnishgather.py", line 95, in run
p = Popen(self.command, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
lkarsten@immer:
/work/varnishgather$
lkarsten@immer:~/work/varnishgather$ git log --oneline | head -n1
7da75b6 Add warning and sleep when run as non-root

Deep/complete varnishgather

Do debug 503s it is often not enough with the 20k varnishlog lines included.

It should be an option to make a complete dump of the shmlog (varnishlog -d) and include that in the .tgz file.

Of course this will make the file very big (50-100MB), which may lead to problems distributing it by mail.

Grab CLI file

Grab the CLI file if you run varnish like this:

varnishd -I /etc/varnish/start.cli -f ""

/proc/meminfo should be included

Mostly to see if the system is using transparent hugetables (AnonHugePages), which is known to cause problems with Varnish on certain systems.

Automatic upload function

We have a small file upload service for customers to send us huge files that isn't possible to send via email.

varnishgather could be extended to have a upload-to-url function, where the produced output file could be POST-ed via curl/wget to this URL.

Since this is HTTP we don't have the usual file size limitations that SMTP has.

This will make data collection simpler for the customer/user.

Output should be in separate files

Now that we're making a tarball of the report anyway, it might be as well to just output each test into another file.

That way you don't have to step through the 5k lines of dmesg just to get to varnishstat below.

Long running varnishlog

Varnishlog runs with -d -k 20000, which runs with no problems on a busy system. On an idle system, however, it will hang for a long time while waiting for 20000 requests. Some timeout might be appropriate.

Gather the stats output from the varnish-agent

Via the agent, we return a slightly different version of stats, that you get via "varnishstat".

localhost:6085/stats

Potential problems:

  • Getting the correct port it is listening on.
  • Getting the username and password for use in "-u".

Possible command, if we assume defaults.

curl -u$(cat /etc/varnish/agent_secret) localhost:6085/stats -o stats.json

Collect files from vcl_path

If the vcl_path is pointing outside of /etc/varnish or /usr, include those directories in the VCLs tar file.

Do not run iptables if the modules are not loaded

Running iptables (-L etc) on a system without the iptables modules loaded will load the modules. Varnishgather should detect if the modules have already been loaded, and only execute the iptables commands if they have.

Consider dmesg -T

The default dmesg output contains timestamps in the form of number of seconds since the system was booted. It is challenging to parse manually.

The -T parameter to dmesg will print human-readable timestamps in the dmesg output, which will make entries in the dmesg output easier to map to entries in other log files.

From the dmesg man page on -T:

Be aware that the timestamp could be inaccurate! The time
source used for the logs is not updated after system SUS-
PEND/RESUME.

Varnish servers are rarely suspended, so this is probably not a problem.

Extract the username from the repo address

I would like to have where possible the username from the repos url, so we can see in the gather how the machine links to the customer.

I feel we must filter out the password.

Via apt or yum

structure in apt source file:

deb https://USER:[email protected]/ubuntu trusty non-free

structure in yum source file:

baseurl=https://USER:[email protected]/redhat/varnish/el$releasever

apt

/etc/apt/sources.list.d/varnish-XXXX.list

yum

/etc/yum/sources.list.d/varnish-XXXX.list

CPU utilisation should be in the report

As Dag pointed out today, there should be some CPU core utilisation numbers in varnishgather.

If varnish is doing excessive regex matches (lots of bans) or somehow has started using a lot of CPU, it isn't really obvious from the current data extracts.

mpstat -A was suggested for Linux. It comes from the sysstat package on rhel and debian, which doesn't seem to be installed by default.

UID - readonly variable

When running the script on RedHat 6.6 it gives a error for the UID variable:

sudo ./varnishgather.sh

./varnishgather.sh: line 43: UID: readonly variable

stdout output is confusing

varnishgather outputs a .tar.gz file, but the text output isn't clear on if the output is the .log file or not.

Update systemd service unit files calls

Update the calls from mycat ...service to to be run systemctl cat ...service. This should also result in some lines becoming redundant (and therefore can be removed).

insecure mode for uploading gather

If a customer's environment has outdated ca certs, they will be unable to upload a varnish gather to our filebin service.
It would be nice if we could provide a simple solution for our customers using varnishgather.

For example, adding the -k argument to the script would enable the corresponding insecure mode in curl.
sh ./varnishgather -k -u simukka

Include varnish-agent persitence directory vcls.

Consider including a tar file of the persistence directory via "-p".

Today, this would require some logic to parse the "defaults/varnish-agent" or the "ps aux" to figure out which directory. An easier way in the future, could be to have the agent write to file, or have it respond via a curl request with its location.

Warn if no varnishd found

It would be helpful if varnishgather output a warning to the user if there is no varnish on the server it is run on.

sysstat

It would be nice to include resource usage information from sysstat (using sar), if it is enabled.

.tgz file should have hostname as a part of directory inside

Currently the .tar.gz files created by varnishgather has a varnishgather/ directory with all the content.

If you uncompress multiple archives in the same directory they will overwrite each other, creating confusion.

Suggestion: let the subdirectory be varnishgather-HOSTNAME/ instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.