Vegeta (software)
{{Short description|HTTP load testing tool}}
{{About|the software|the Dragon Ball character|Vegeta|other uses|Vegeta (disambiguation)}}
{{Use mdy dates|date=August 2022}}
{{Infobox software
| title = Vegeta
| screenshot = Vegeta attack example.png
| screenshot alt = A command run via vegeta with the resulting output
| caption = Vegeta's reported results after being run to attack a server running on
| author = Tomás Senart{{Cite web |last=Senart |first=Tomás |date=October 11, 2020 |title=GitHub - tsenart/vegeta: HTTP load testing tool and library. It's over 9000! |url=https://github.com/tsenart/vegeta |url-status=live |archive-url=https://web.archive.org/web/20220811020832/https://github.com/tsenart/vegeta |archive-date=August 11, 2022 |access-date=August 27, 2022 |website=GitHub}}
| released = {{Start date and age|2013|08|13|df=no}}{{Cite web |last=Senart |first=Tomás |date=August 13, 2013 |title=Initial commit |url=https://github.com/tsenart/vegeta/commit/40deb7a1f44b1d281eaedea32b75f49e7150169a |url-status=live |archive-url=https://web.archive.org/web/20220828040838/https://github.com/tsenart/vegeta/commit/40deb7a1f44b1d281eaedea32b75f49e7150169a |archive-date=August 28, 2022 |access-date=August 27, 2022 |website=GitHub}}
| latest release version = {{wikidata|property|preferred|references|edit|P348|P548=Q2804309}} | latest release date = {{Start date and age|{{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}}|df=yes}}
| repo = {{URL|https://github.com/tsenart/vegeta}}
| programming language = Go
| operating system = Linux, Microsoft Windows, macOS
| genre = HTTP Load testing
| license = MIT License
| website = {{URL|https://pkg.go.dev/github.com/tsenart/vegeta/lib}}
}}
Vegeta is an HTTP load testing tool written in Go that can be used as a command in a command-line interface or as a library. The program tests how an HTTP-based application behaves when multiple users access it at the same time{{Cite web |date=May 26, 2022 |title=Load Testing with Vegeta |url=https://www.scaleway.com/en/docs/tutorials/load-testing-vegeta/ |url-status=live |archive-url=https://web.archive.org/web/20211016154329/https://www.scaleway.com/en/docs/tutorials/load-testing-vegeta/ |archive-date=October 16, 2021 |access-date=August 27, 2022 |website=Scaleway}} by generating a background load of GET requests.{{Cite book |last=Eiermann |first=Andreas |url=https://www.worldcat.org/oclc/990058133 |title=Innovations for community services : 17th International Conference, I4CS 2017, Darmstadt, Germany, June 26-28, 2017, Proceedings |last2=Renner |first2=Mathias |last3=Großmann |first3=Marcel |last4=Krieger |first4=Udo R. |date=2017 |isbn=978-3-319-60447-3 |editor-last=Eichler |editor-first=Gerald |location=Cham, Switzerland |pages=83 |chapter=On a Fog Computing Platform Built on ARM Architectures |oclc=990058133 |editor-last2=Erfurth |editor-first2=Christian |editor-last3=Fahrnberger |editor-first3=Günter}} Vegeta is used to generate a sustained, constant number of requests per second in order to discover how long a service can sustain a peak load before dropping in performance.{{Cite book |last=De |first=Brajesh |url=https://www.worldcat.org/oclc/978273106 |title=API management : an architect's guide to developing and managing APIs for your organization |date=2017 |isbn=978-1-4842-1305-6 |edition=First |location=New York |pages=161 |oclc=978273106 |access-date=August 27, 2022 |archive-url=https://web.archive.org/web/20220828040838/https://www.worldcat.org/title/978273106 |archive-date=August 28, 2022 |url-status=live}}
In addition to preemptive load testing, the program can also be used for shadow testing,{{Cite book |last=Welch |first=Nat |url=https://www.worldcat.org/oclc/1056157467 |title=Real-world SRE : the survival guide for responding to a system outage and maximizing uptime |date=2018 |publisher=Packt |isbn=978-1-78862-644-6 |location=Birmingham, UK |pages=137 |oclc=1056157467}} where traffic from a live version of an application is mirrored onto a test version to determine how it handles the same traffic load, without causing potential disruption to the live version of the application.{{Cite web |date=February 5, 2020 |title=Application deployment and testing strategies |url=https://cloud.google.com/architecture/application-deployment-and-testing-strategies#shadow_test_pattern |access-date=August 28, 2022 |website=Google Cloud}} Shadow testing is done in this way in order to analyze anticipated server performance.{{Cite book |last=Qi |first=Lin |url=https://www.worldcat.org/oclc/1225562925 |title=Mobile wireless middleware, operating systems and applications : 9th EAI International Conference, MOBILWARE 2020, Hohhot, China, July 11, 2020, Proceedings |last2=Qiao |first2=Zhihong |last3=Zhang |first3=Aowei |last4=Qi |first4=Hui |last5=Ren |first5=Weiwu |last6=Di |first6=Xiaoqiang |last7=Wang |first7=Rui |date=2020 |isbn=978-3-030-62205-3 |editor-last=Tang |editor-first=Dalai |location=Cham, Switzerland |pages=70 |chapter=Performance Analysis of QUIC-UDP Protocol Under High Load |oclc=1225562925 |access-date=August 27, 2022 |editor-last2=Li |editor-first2=Wuyungerile |archive-url=https://web.archive.org/web/20220828041010/https://www.worldcat.org/title/1225562925 |archive-date=August 28, 2022 |url-status=live}}
Vegeta is provided for use by web hosting services such as Scaleway to use varied and multiple requests to stress test client HTTP services.{{Cite web |last=Dumitrescu |first=Sorin |date=July 10, 2020 |title=Black Friday. 0 downtime. How Bunnyshell & Vegeta & UiPath can help |url=https://www.bunnyshell.com/blog/black-friday-zero-downtime-deployments |url-status=live |archive-url=https://web.archive.org/web/20220828040933/https://www.bunnyshell.com/blog/black-friday-zero-downtime-deployments |archive-date=August 28, 2022 |access-date=August 27, 2022 |website=BunnyShell.com}} It is also used with dedicated load-testing platform services such as BlazeMeter.{{Cite web |last=Levental |first=Alla |date=August 26, 2021 |title=Vegeta Load Testing |url=https://www.blazemeter.com/blog/vegeta-load-testing |url-status=live |archive-url=https://web.archive.org/web/20220828040933/https://www.blazemeter.com/blog/vegeta-load-testing |archive-date=August 28, 2022 |access-date=August 27, 2022 |website=BlazeMeter}}
Usage
The command-line usage is in the format of {{kbd|vegeta [global flags]
The commands available are {{kbd|attack}}, {{kbd|encode}}, {{kbd|plot}}, and {{kbd|report}}, each with its own various command flag options, and both attack input and report output can be done in an optional JSON format when specified with the appropriate flag.
Vegeta can specify targets as URLs in a separate file with optional custom headers and requests, which can then be used as an input option on the command line.{{Cite book |last=Osman |first=Paul |url=https://www.worldcat.org/oclc/1055162428 |title=Microservices development cookbook : design and build independently deployable, modular services |date=2018 |publisher=Packt |isbn=978-1-78847-636-2 |location=Birmingham, UK |pages=210 |oclc=1055162428 |access-date=August 27, 2022 |archive-url=https://web.archive.org/web/20220828040943/https://www.worldcat.org/title/1055162428 |archive-date=August 28, 2022 |url-status=live}}
=Example=
An example usage would be to issue {{kbd|