Endoscope

 view release on metacpan or  search on metacpan

lib/Endoscope.pm  view on Meta::CPAN

		Req/Sec     1.09k    10.68     1.11k    70.00%
	  130455 requests in 1.00m, 18.56MB read
	Requests/sec:   2174.22
	Transfer/sec:    316.77KB

=head3 DISCUSSION

The baseline program delivered 2365 requests per second in the face of clients
demanding 2500 requests per second. The C<Endoscope> variant delivered 2174
requests per second, or 91.92% of baseline. In other words, C<Endoscope> in the
given configuration reduces capacity by about 8.1%.

8.1% can be seen as a lower bound on overhead with a query firing once per
request on saturated, CPU-bound Mojolicious web apps. Queries that fire more
than once per request, or which do expensive work while exporting data, may
have a higher impact. However, most real-world applications:

=over 2

=item *

Do not run at their 'red line' of capacity, and

=item *

Do significantly more work than render out "Hello World".

=back

So, you are encouraged to measure for yourself.

=head4 UNSATURATED

In order to avoid misrepresenting the performance of Mojolicious (or my laptop
:)), here's an example "unsaturated" test case, which is representative of the
performance of both the baseline and the variant. I won't specify which one
this is, because the variance from run to run is too high to get a meaningful
ordering:

	$ wrk 'http://localhost:3000/hello' -R 2000 -d 60
	Running 1m test @ http://localhost:3000/hello
	  2 threads and 10 connections
	  Thread calibration: mean lat.: 5.213ms, rate sampling interval: 10ms
	  Thread calibration: mean lat.: 5.041ms, rate sampling interval: 10ms
	  Thread Stats   Avg      Stdev     Max   +/- Stdev
		Latency     4.28ms    0.88ms  21.57ms   92.20%
		Req/Sec     1.05k   122.54     1.67k    65.38%
	  119971 requests in 1.00m, 17.07MB read
	Requests/sec:   1999.48
	Transfer/sec:    291.31KB

=head1 SECURITY

C<Endoscope> is a powerful tool for debugging running systems by inspecting
their memory. This means that anyone who is able to configure C<Endoscope>
queries and view their output can read the contents of nearly any variable
present in memory. As such, access to these capabilities should be carefully
guarded.

For example, if C<Endoscope> is integrated into a web framework and exposes
a special HTTP endpoint for configuring queries, that endpoint should only be
accessible from the host where the application is running, not externally.
Additionally, that HTTP endpoint should be gated by strong
authentication/authorization.

=head1 SEE ALSO

=over 4

=item *

L<Devel::Optic>

=item *

L<Devel::Probe>

=item *

L<Enbugger>

=back

=head1 AUTHOR

Ben Tyler <btyler@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Ben Tyler.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 0.912 second using v1.01-cache-2.11-cpan-524268b4103 )