I hope this is your first name. Since Julio doesn't answer I will do it.
Rygg Christian wrote:
I'm developing a non-web-based interface to OpenCA, but I'm having some
speed problems. I've rewritten basic_csr so it jump directly to the
client-confirmed-form operation. I also rewrote issueCertificate. Calling
these two in succession takes 39-40 seconds (!), which I find a bit too
long, even on a 300 MHz with 64 MB RAM.
Looking into the code, I find the (biggest) culprit (int basic_csr):
my $req_elements = $db->elements (DATATYPE => "REQUEST");
This takes 29 seconds.
So, I look in DB.pm and the elements sub. The culprit here is:
my @list = $self->searchItems (DATATYPE => $dataType);
This takes 29 seconds, so I look into the searchItems sub. Here the repeated call of this line is the culprit:
push (@retList, $self->listItems(DATATYPE=>$dataType, PARSE_MODE => $parse_mode));
The first time it is called, it takes 10 seconds. The second, 19 seconds. The third and fourth time it takes 0 seconds.
I'm using the database which is installed when I install OpenCA. Is there any reason why this push command should take SO long? What can I do to make it do whatever it is doing quicker?
The actual problem is our module OpenCA::OpenSSL. It uses OpenSSL's commandline tool to parse requests and certificates. This means that if you have 20 certificates or requests then we create 20 child processes and this takes a long time.
Julio starts to develop OpenCA::OpenSSL::Fast. This module uses the cryptlib of OpenSSL directly for parsing certificates. So we don't need the overhead for the childprocesses. I don't know the state of the development.
The other problem is that it looks like $db->elements calls seachItems in the wrong mode. Normally there is a mode which don't parse the requests and only count them (MODE=>"RAW"). I will take a look into the module. Perhaps I should write a notice to Max - he is the maintainer of OpenCA::DB.
Best regards
Michael -- ------------------------------------------------------------------- Michael Bell Email (private): [EMAIL PROTECTED] Rechenzentrum - Datacenter Email: [EMAIL PROTECTED] Humboldt-University of Berlin Tel.: +49 (0)30-2093 2482 Unter den Linden 6 Fax: +49 (0)30-2093 2704 10099 Berlin Germany http://www.openca.org
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
OpenCA-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-devel
