Forum Discussion
is pycontrol slower than the perl API?
the most basic example I have that demostrates this, well at lest for me, is getting a list of Virtual Servers. In perl getting the interface to the F5 and using get_list is very quick, undes 2 secs, while in python it takes 10+ secs.
any help or suggestions is welcomed.
--
Jeremy
15 Replies
- snovakov_86258
Nimbostratus
If I'm not mistaken, I believe that iControl is written in Perl. That's why I stick with Perl. No need for using annoying WSDL files, either. - yozik_100692
Nimbostratus
thanks for the quick answer. It's unfortunate that the slowness is so noticable. Trust me I'd love to stick with perl, but I need to re-write the code so that everyone can support it.Guess I need to find a way to make things appear not so slow.
--
Jeremy
- snovakov_86258
Nimbostratus
I hear ya, Jeremy. It's funny, but to me object-oriented Perl (a-la Damian Conway) is no more difficult to understand and write than Python. And the environment is noticeably faster in Perl, too, as you've discovered. Too bad everyone can't just get along... - mhite_60883
Cirrocumulus
Have you tried referencing the WSDL locally rather than downloading it? That might give you a performance bump. Also, you can probably eliminate a lot of back-and-forth if you use V11 transactions (where appropriate). - yozik_100692
Nimbostratus
mhite, no I haven'tdo you have some reference code on how to do that ?
I'm currently just doing the wsdsl = ['LocalLB.VirtualServer'] as shown in the examples
--
Jeremy
- mhite_60883
Cirrocumulus
class BIGIP(__builtin__.object)
| Wrap suds client object(s) and create a user-friendly class to use.
|
| Methods defined here:
|
| __init__(self, hostname=None, username=None, password=None, wsdls=None, directory=None, fromurl=False, debug=False, proto='https')
So I think you would just supply a "directory=" argument... might take some fiddling/experimentation. - yozik_100692
Nimbostratus
thanksI'll spend some time on this and see if there are any improvements
--
Jeremy
- Posted By snovakov on 01/31/2012 09:44 AM
If I'm not mistaken, I believe that iControl is written in Perl. That's why I stick with Perl. No need for using annoying WSDL files, either.
You are mistaken B-). iControl means a lot of things to a lot of people. When you say "iControl is written in perl", I take that to mean that the server implementation is in Perl. That is a native C++ app that sits under apache talking directly to our configuration database. The other (client) side is really dependent on the toolset you use. We provide the XML descriptions for the methods (WSDL) and the client toolkit will, in most cases, build proxy code in the native language that reads from and writes to the SOAP XML that goes across the wire. The time that it takes the SOAP request (XML) to be sent to the BIG-IP and when the response returns, should be static across different client libraries. The difference is how the client code processes the XML into it's native language.
I'm have a soft spot for Perl as that was the language I used to test the client side piece when I was developing the original iControl server code. In fact, that was the first time I'd ever used Perl so don't be too critical in the sample code I've provided over the years. Our examples with Perl have no client bindings at all. It is up to the developer to build the correct packaging of parameters and pass them along. The benefit of the higher level toolkits (.Net, PowerShell, and Java) is that they build strong client bindings (meaning you can't make a method call if you don't have the parameters defined correctly). With Perl and Python, you can pass whatever you want and if the server code can't determine that what you passed is an array when it expects an array, you'll get an error back.
I personally code in Perl and PowerShell when possible for personal preference. Maybe someday I'll have to build up my skills with Python.
As for the slowness with pyControl, it probably is due to the downloading of the WSDLs for each new session. As was mentioned in this thread, you can manually copy them locally so that the server request for that WSDL doesn't need to occur.
-Joe - yozik_100692
Nimbostratus
Joe,thanks for the information. It helps my understanding of how things run under the hood a little bit better. I'm partial to perl as well but got tired of using CGI::Ajax and wanted to move over to web2py. Any how, I'm working on configuring the BIGIP object to use a local copy of the wsdl to see if that helps with the delay.
thanks
--
Jeremy
- That's the first I've heard of using CGI::Ajax for iControl. I've only used SOAP::Lite in the past. I guess from your comment, it's probably not worth exploring B-)...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
