directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ersin Er <ersin...@gmail.com>
Subject Re: Profiling DirServer with TPTP
Date Sun, 09 Apr 2006 06:46:24 GMT
Ole Ersoy wrote:
> Hey Guys,
>   
Hi Ole,
> I tried playing with TPTP a little.
>
> Amazing tool.  It produces UML2 class and thread
> interaction diagrams that highlight in red application
> hot spots.
>   
I had a glance at it. It really looks cool.
> I hit some rough spots just going by the TPTP
> tutorial, and I'll mention those + solution further
> down in the email.
>
> So now I'm trying to think what the right strategy is
> for testing the DS?
>   
I think there are two strategies which I'll mention below.
> So suppose I created a JNDI client that created say 10
> threads that all hammered DS with lookup requests,
> should that produce the concurrency issue?
>   
I don't think that we have the concurrency issue any more.
> Now when I did the TPTP tutorial I profiled the
> Product example...So I profiled a Java Application. 
> With the approach above I would be profiling a server
> using a client.
>
> That's a little trickier.  I'd most likely have to
> write a Probe (Which the Eclipse help is very good
> about explaining under "Monitoring and Analyzing
> Performance > Collecting Runtime Data With User
> Defined Probes") and then use it to collect data on DS
> while the client is running.
>
> The simpler way though would be to run DS as a
> application and just collect performance data that
> way.
>
> This would require me to check out the DS code, and
> then figure out how to run methods on it directly from
> a client sitting in the same project directory.
>
> I don't think I would want to go through JNDI, since
> that means I'll be tunneling through a lot of JNDI
> method calls...assuming there's a more direct way of
> achieving the usage pattern...?
>   
"Direct way" of performing operations on ApacheDS is again JNDI. Because 
ApacheDS core API is provided as JNDI. So programming to ApacheDS over 
wire or embedding it are same, cool eh ? ;-)

So, to use the "direct way" which I mean embeddeding ApacheDS and making 
the profiling within the embedder application "without going on the 
wire", you just need to start ApacheDS within your application and do 
some extensive bind/search/unbind operations on the JNDI Context which 
is really the core. So when you right click on this Application in 
Eclipse and select Profile As Java Application everything will go as in 
the tutorial, I wish :)

This way requires setting the Context.INITIAL_CONTEXT_FACTORY as 
"org.apache.directory.server.core.jndi.CoreContextFactory" in 
environment variables configuration as you can see in the example.

To have an idea about how to embed ApacheDS you may check out here:
https://svn.safehaus.org/repos/sandbox/apachecon-m2/simple/

The second way which is "the real way", "the on-wire way", which will 
also show the network and related performance is to run (Profile As Java 
Application) ApacheDS standalone with network support. And than you can 
connect to it with JNDI over wire with a second application to do some 
extensive bind/search/unbind (or whatever else) operations (with 
possibly more than one thread if you want to see the concurrent 
performance).

This way requires setting the Context.INITIAL_CONTEXT_FACTORY as 
"org.apache.directory.server.jndi.ServerContextFactory" in environment 
variables configuration as you can see in the example. To do this you 
may again embed ApacheDS within a simple application or you may start 
ApacheDS within Eclipse with server.xml on your classpath where you can 
configure which services will be started and which will not. For 
example, you would not want to start Kerberos service probably.

The embedding+ldap service support example is here:
https://svn.safehaus.org/repos/sandbox/apachecon/ldap/
> In that case how would I write that client so that I'm
> calling DS methods directly and which methods should
> be profiled first?
>   
I think the whole server can be tested at once and the most time taking 
parts will be shown by Eclipse so there will be no need to go deep into 
the server code.
> OK - Here's some key notes from the TPTP experience.
>
> The tutorial:
>
> http://www.eclipse.org/articles/Article-TPTP-Profiling-Tool/tptpProfilingArticle.html
>
> is very helpful, however there's no mention of THIS:
>
> Here's the context:
> You right click on the Product class
> Profile As > Java Application
>
> This brings up the "Edit Launch and Configuration
> Properties"
>
> Here you have to do what he says, BUT you also 
> have to go to the 
>
> Environment tab
>
> and create the variable "PATH"
>
> which needs to be set to the bin directory of the 
>
> Raserver...
>
> The Raserver is what collects data...you need to
> install it as part of the TPTP installation...very
> straight forward though.
>
> So to get the tutorial working all I did was 
>
> Install TPTP via the update site
>
> Install the Raserver...unzipped and used the
> getting_started.html install instructions in the root
> install directory to configure and run...
>
> And now it works...
Sorry, I did not have time to try this but I'll do.
> If anyone has any questions or needs help with it I'll
> be glad to do more research.  
>
> Cheers,
> - Ole
HTH,

-- 
Ersin

Mime
View raw message