Revision 4907
Added by daigle over 15 years ago
testing-metacat.html | ||
---|---|---|
56 | 56 |
<div class="toc2"><a href="#TestingWebLDAP">Testing LDAP Web Interface</a></div> |
57 | 57 |
<div class="toc2"><a href="#TestingRegistry">Testing Metadata Registry</a></div> |
58 | 58 |
<div class="toc2"><a href="#TestingEcogridRegistry">Testing the EcoGrid Registry Service</a></div> |
59 |
<div class="toc1"><a href="#LoadTesting">Load Testing</a></div> |
|
60 |
<div class="toc2"><a href="#LoadTestCodeFiles">Load Test Code Files</a></div> |
|
61 |
<div class="toc2"><a href="#GeneratingDictionaryFiles">Generating Dictionary Files</a></div> |
|
62 |
<div class="toc2"><a href="#InsertLoadTest">Insert Load Test</a></div> |
|
63 |
<div class="toc2"><a href="#SQueryLoadTest">SQuery Load Test</a></div> |
|
64 |
<div class="toc2"><a href="#ReadLoadTest">Read Load Test</a></div> |
|
65 |
<div class="toc2"><a href="#TestDriverScript">Test Driver Script</a></div> |
|
66 |
<div class="toc1"><a href="#ProfilingMetacat">Profiling Metacat</a></div> |
|
59 | 67 |
</div> |
60 | 68 |
|
61 | 69 |
<a name="Intro"></a><div class="header1">About Metacat Testing</div> |
... | ... | |
486 | 494 |
</li> |
487 | 495 |
</ul> |
488 | 496 |
|
497 |
<a name="LoadTesting"></a><div class="header1">Load Testing</div> |
|
498 |
<p>This section dicussed the available load testing code and its usage.</p> |
|
499 |
|
|
500 |
<a name="LoadTestCodeFiles"></a><div class="header2">Load Test Code Files</div> |
|
501 |
<p>The code to do load testing is located in the metacat project in this directory:</p> |
|
502 |
<div class="code"><metacat_src>/test/stress-test</div> |
|
503 |
|
|
504 |
<p>The test code files are written in python for the following tests:</p> |
|
505 |
|
|
506 |
<ul> |
|
507 |
<li> read - read-load-test.py </li> |
|
508 |
<li> insert - insert-load-test.py </li> |
|
509 |
<li> squery - squery-load-test.py </li> |
|
510 |
</ul> |
|
511 |
|
|
512 |
<p>While these can be run directly from the command line, there is also a driver |
|
513 |
file written in bash for convenience named: load-test-driver.sh</p> |
|
514 |
|
|
515 |
<p>The insert and squery tests rely on the following template files respectively: </p> |
|
516 |
<div class="code">insert.xml.tmpl and squery.xml.tmpl</div> |
|
517 |
|
|
518 |
<p>The insert and squery tests rely on dictionary files to create unique document IDs. |
|
519 |
These files are generated using a shell script named:</p> |
|
520 |
<div class="code">generate-dictionaries.sh</div> |
|
521 |
|
|
522 |
<p>Each of these files will be discussed in the next sections</p> |
|
523 |
|
|
524 |
<a name="GeneratingDictionaryFiles"></a><div class="header2">Generating Dictionary Files</div> |
|
525 |
|
|
526 |
<p>The insert and squery tests (see following sections) will need to create unique document IDs to avoid conflicts and to bypass caching mechanisms. The dictionary files are created by running: |
|
527 |
<div class="code">./generate-dictionaries.sh</div> |
|
528 |
|
|
529 |
<p>This will create a separate file for each letter of the alphabet that looks like:</p> |
|
530 |
<div class="code">dictionary-a.txt, dictionary-b.txt, etc.</div> |
|
531 |
|
|
532 |
<p>Each file will contain all the five letter word combinations that start with the |
|
533 |
letter associated with that file. You should run this script right away, as it takes a little |
|
534 |
time to run.</p> |
|
535 |
|
|
536 |
<a name="InsertLoadTest"></a><div class="header2">Insert Load Test</div> |
|
537 |
|
|
538 |
<p>The insert load test is run via a python script with the following usage:</p> |
|
539 |
<div class="code">./insert-load-test.py <letter> <iterations> <interval> <host> 2>&1 &</div> |
|
540 |
|
|
541 |
<p>Where:</p> |
|
542 |
|
|
543 |
<ul> |
|
544 |
<li> letter - the letter of the dictionary you want to use to generate doc IDs.</li> |
|
545 |
<li> iterations - the number of inserts you would like the test to perform.</li> |
|
546 |
<li> interval - the delay in seconds between each insert. You can enter a decimal for |
|
547 |
less than one second.</li> |
|
548 |
<li> host - the server that is running the instance of metacat you are load testing. |
|
549 |
You should not be running the test drivers on the same machine as metacat, since that |
|
550 |
could affect the outcome of the load test.</li> |
|
551 |
</ul> |
|
552 |
|
|
553 |
<p>The insert test will iterate through the dictionary for the letter you have specified. |
|
554 |
For each word, it will create a doc ID that looks like:</p> |
|
555 |
<div class="code"><word><epoch_date>.<epoch_date>.1</div> |
|
556 |
|
|
557 |
<p>For instance, if the test started at epoch date 123914076495 and the 67th word in the |
|
558 |
dictionary file (for letter c) is caacp, your doc ID will look like:</p> |
|
559 |
<div class="code">caacp123914076495.67.1</div> |
|
560 |
|
|
561 |
<p>This docid is subtituted for each values of @!docid!@ in the insert template at:</p> |
|
562 |
<div class="code">insert.xml.tmpl</div> |
|
563 |
|
|
564 |
<p>Each doc will then be inserted into Metacat using the metacat.py interface file.</p> |
|
565 |
|
|
566 |
<p>Output will be written to a file named:</p> |
|
567 |
<div class="code">insert-<letter>.out</div> |
|
568 |
|
|
569 |
<p>Note that you can run several of the insert tests at the same time. You should run |
|
570 |
each against a different letter to avoid doc ID naming conflicts and to be able to |
|
571 |
view the output from each test in a different output file. See the load-test-driver.sh |
|
572 |
for some examples.</p> |
|
573 |
|
|
574 |
<a name="SQueryLoadTest"></a><div class="header2">SQuery Load Test</div> |
|
575 |
|
|
576 |
<p>The squery load test is run via a python script with the following usage:</p> |
|
577 |
<div class="code">./squery-load-test.py <letter> <iterations> <interval> <host> 2>&1 &</div> |
|
578 |
|
|
579 |
<p>Where:</p> |
|
580 |
|
|
581 |
<ul> |
|
582 |
<li> letter - the letter of the dictionary you want to use to generate doc IDs.</li> |
|
583 |
<li> iterations - the number of squeries you would like the test to perform.</li> |
|
584 |
<li> interval - the delay in seconds between each squery. You can enter a decimal for |
|
585 |
less than one second.</li> |
|
586 |
<li> host - the server that is running the instance of metacat you are load testing. |
|
587 |
You should not be running the test drivers on the same machine as metacat, since |
|
588 |
that could affect the outcome of the load test.</li> |
|
589 |
</ul> |
|
590 |
|
|
591 |
<p>The squery test will iterate through the dictionary for the letter you have specified. |
|
592 |
For each word, it will create a query by substituting the dictionary word for every |
|
593 |
instance of @!search-word!@ in the squery template at:</p> |
|
594 |
<div class="code">squery.xml.tmpl</div> |
|
595 |
|
|
596 |
<p>Each of these queries will be run against Metacat using the metacat.py interface file. |
|
597 |
By changing the query for each word, we insure that we do not get cached query results |
|
598 |
back from Metacat, which would not cause a significant load.</p> |
|
599 |
|
|
600 |
<p>Output will be written to a file named:</p> |
|
601 |
<div class="code">squery-<letter>.out</div> |
|
602 |
|
|
603 |
<p>Note that you can run several of the squery tests at the same time. You should run |
|
604 |
each against a different letter to avoid doc ID naming conflicts and to be able to |
|
605 |
view the output from each test in a different output file. See the load-test-driver.sh |
|
606 |
for some examples. If you are going to run a test against the same letter more than |
|
607 |
once, you will need to restart the instance of Metacat being tested to clear the query |
|
608 |
cache on that system.</p> |
|
609 |
|
|
610 |
<a name="ReadLoadTest"></a><div class="header2">Read Load Test</div> |
|
611 |
|
|
612 |
<p>The read load test is run via a python script with the following usage:</p> |
|
613 |
<div class="code">./read-load-test.py <letter> <iterations> <interval> <host> 2>&1 &</div> |
|
614 |
|
|
615 |
<p>Where:</p> |
|
616 |
|
|
617 |
<ul> |
|
618 |
<li> letter - the read test does not use a dictionary. The letter helps us insure that |
|
619 |
each test reads a different document, and writes to its own output file.</li> |
|
620 |
<li> iterations - the number of reads you would like the test to perform.</li> |
|
621 |
<li> interval - the delay in seconds between each read. You can enter a decimal for |
|
622 |
less than one second.</li> |
|
623 |
<li> host - the server that is running the instance of metacat you are load testing. |
|
624 |
You should not be running the test drivers on the same machine as metacat, since |
|
625 |
that could affect the outcome of the load test.</li> |
|
626 |
</ul> |
|
627 |
|
|
628 |
<p>The read test will create a doc ID that looks like:</p> |
|
629 |
<div class="code">readtest-<letter><epoch_date>.1.1</div> |
|
630 |
|
|
631 |
<p>It will do a single insert using that doc ID and the template at:</p> |
|
632 |
<div class="code">insert.xml.tmpl</div> |
|
633 |
|
|
634 |
<p>It will then do a read of that document from Metacat using the metacat.py interface |
|
635 |
file for the number of iterations you have specified.</p> |
|
636 |
|
|
637 |
<p>Output will be written to a file named:</p> |
|
638 |
<div class="code">read-<letter>.out</div> |
|
639 |
|
|
640 |
<p>Note that you can run several of the read tests at the same time. You should run |
|
641 |
each against a different letter to avoid doc ID naming conflicts and to be able to |
|
642 |
view the output from each test in a different output file. See the load-test-driver.sh |
|
643 |
for some examples.</p> |
|
644 |
|
|
645 |
<a name="TestDriverScript"></a><div class="header2">Test Driver Script</div> |
|
646 |
|
|
647 |
<p>There is a very simple driver script that allows you to easily run multiple instances |
|
648 |
and combinations of the different load tests called:</p> |
|
649 |
<div class="code">./load-test-driver.sh</div> |
|
650 |
<p>Uncomment the tests you want to run. </p> |
|
651 |
|
|
489 | 652 |
<br> |
490 | 653 |
<a href="./metacat-eclipse-project.html">Back</a> | <a href="./index.html">Home</a> | |
491 | 654 |
<!--a href="add next file here when one exists" -->Next<!-- /a --> |
Also available in: Unified diff
Add load test documentation