DX NetOps

Expand all | Collapse all

CA Spectrum REST WEB API speed...why it's so slow?

  • 1.  CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 23, 2014 08:15 PM

    I am working on the task of automating  a report including  all interfaces in CA Spectrum. I am able to send POST tunneled XML request to show me all models of certain type , including the attributes I need.

    On the one hand everything is working fine: I send XML with POST, get a first response according to my "throttlesize" and after that I am following the "next" links with subsequent GET requests, until I retrieve the whole data. The only thing I am not satisfied is a speed.

    If I query the  list of all ports through the WEB REST API , I get a significant delay between my requests and server responses, which depends on throttlesize. The bigger  throttlesize I put in the initial request, the longer I have to wait for server responses.

    For example , if I make  "throtteseze" of 500 models I have to wait for EVERY response for 4-6 minutes. Again,  this happens with every subsequent request.  In this case, report  about all 11 thousands ports takes almost 2 hours. It's a lab environment , and production has 10 times more ports, so, potentially,  we are talking about 20 hours of getting data.

    As I understand how it should work: the delay between the initial  request and the first response  is normal, but no delays after. All data on the server should be cached  and "ready to go" after the first initial request.  If I query the list of all ports in OneClick GUI I have it withing seconds, the same 11 thousands ports.

    Is anybody having the same issue?

    Does our server  has something to fix ?

    Or may be  it works properly and  I am expecting  too much from it?



  • 2.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 24, 2014 04:31 AM

    Hi,

    I do the same but request always with a high throttlesize and haven´t seen this effekt.

    perhaps, it would be better to fetch the interfaces by the SRMDBAPI.

    In this case, You grab "old" data but it would be faster than 2hours.

     

    Take care that You have to check there is a "deleted" field in the table. ... do not not report already deleted interfaces.

     

    Probably, it would be easier to follow Your bug if we could see your Rest-Query!

     

    Best Regards

    Erich



  • 3.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 24, 2014 05:03 AM

    Hi, I believe I know that pitfall which You used.

    You request attributes which are external attributes.

    Yes? - I recommend to not use external attributes.

     

    Spectrum provides a "fallback" for many attributes. They store the operational-status / admin-status and other Mib2 - Statistics in cached attributes.

    For many attributes, with every poll of an SNMP-Variable, they store the result in a variable which has nearly the same name but got a postsuffix like '_1'.

    You could query them very fast. Change Your Rest-Request and allthing will work fine *-)

     

    Otherwise, attach Your REST-Request here and we could check it all together.

     

    Best Regards

    Erich



  • 4.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 24, 2014 08:16 AM

    One thing I have noticed is that it makes a big difference where you run the scripts from. We have a global domain so when I need to run a script I run it from the OneClick server for that region.

     

    Also I don't use a proxy. That's just extra delay when you don't need it.

     

    Also getting a list of all ports in Spectrum is a big request. There can be millions of ports/interfaces, so I would expect that this could take some time.


    Regarding your delays between each throttle portion of results, I've not seen that before. Perhaps check the catalina.out log of the one click Server you are requesting the info from. There might be something in there (%SPECROOT%/tomcat/logs).



  • 5.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 24, 2014 11:53 AM

    Thank you for all replies!

     

    @e.heinemann  : I don't know what is SRMDBAPI or "external" attribute. Can you provide the documentation file name, so I can read about it?

                                   I will post my initial request tomorrow, as long as I get in to the office.

     

    @franktjonjes :  We have proxy, but I think it's not used for local sites, I will double check tomorrow in the office.

                                  Also, I will try to run the script from the OneClick Server itself.  I don't beleive  that proxy could  add such a significant delay.

                                  I have a strong feeling that something is wrong on the OneClick Server itself.

     



  • 6.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 25, 2014 08:56 AM

    Here is my XML request below:

     

    -------------------------------------------------------------------------------------------------start of the file--------------------------------------------------------------------------------------------------------------------------

    <?xml version="1.0" encoding="UTF-8"?>

     

     

    <rs:model-request throttlesize="500"

      xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd ">

     

     

     

     

        <rs:target-models>

          <rs:models-search>

      

      <rs:search-criteria >

      <filter:filtered-models xmlns:filter="http://www.ca.com/spectrum/restful/schema/filter">

      <filter:equals>

      <filter:attribute id="0x10000">

      <filter:value>Gen_IF_Port</filter:value>

      </filter:attribute>

      </filter:equals>

      </filter:filtered-models>

      </rs:search-criteria>

      

      

          </rs:models-search>

        </rs:target-models>

     

     

      <rs:requested-attribute id="0x1006e" /> <!-- Model Name  -->

      <rs:requested-attribute id="0x10032" /> <!-- Manufacturer  -->

        <rs:requested-attribute id="0x11f6f" /> <!-- ifName  -->

        <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

      <rs:requested-attribute id="0x12dbb" /> <!-- IP Address  -->

      <rs:requested-attribute id="0x10e3f" /> <!-- ifAdminStatus  -->

      <rs:requested-attribute id="0x10e40" /> <!-- ifOperStatus  -->

      <rs:requested-attribute id="0x1134b" /> <!-- ifDesc  -->

      <rs:requested-attribute id="0x11f7e" /> <!-- ifAlias  -->

        <rs:requested-attribute id="0x11f6b" /> <!-- ifHighSpeed  -->

      <rs:requested-attribute id="0x1134c" /> <!-- ifType -->

     

     

    </rs:model-request>

     

     

    -------------------------------------------------------------------------------------------------end of the file--------------------------------------------------------------------------------------------------------------------------



  • 7.  Re: CA Spectrum REST WEB API speed...why it's so slow?
    Best Answer

    Posted Aug 25, 2014 11:48 AM
      |   view attached

    Hi,

    yes, thats what I thought.

    You are using external attributes.

     

    To be able to follow me,

    “external attributes” are all attributes of the model which are polled in the moment when You touch or read the model.

    In Your case, You would like to get these attributes which are all “external” .

    (Internal attributes are attributes which are not polled) … Check this by opening the “Device Details” for the Interface and then use the Tab “Attributes” where You could see some optional Columns for the attributes (left side).

    There are some Flags like  “E” for Externam and R for “Readable” etc.

     

     

      <rs:requested-attribute id="0x11f6f" /> <!-- ifName  -->

      <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

    <rs:requested-attribute id="0x12dbb" /> <!-- IP Address  -->

      <rs:requested-attribute id="0x10e3f" /> <!-- ifAdminStatus  -->

      <rs:requested-attribute id="0x10e40" /> <!-- ifOperStatus  -->

      <rs:requested-attribute id="0x1134b" /> <!-- ifDesc  -->

      <rs:requested-attribute id="0x11f7e" /> <!-- ifAlias  -->

       <rs:requested-attribute id="0x11f6b" /> <!-- ifHighSpeed  -->

      <rs:requested-attribute id="0x1134c" /> <!-- ifType -->

     

    Your attributes are mostly externaly and would be polled in the moment when You run Your request.

     

    The better solution would be would be to replace every attribute with an already polled attribute which is not “External”.

    .. and believe me, then it will run very fast.

     

    In some cases, admins try to poll attributes like InOctets etc. to push them into external tools like .. whatever.

    For these cases, there are internal attributes available with a Prefix “X_”, for example “X_InOctets” which Spectrum updates as long as a threshold is defined for this interface.

    These could be used very fast with the Soap-API or the REST-API.

     

    In Your case, there are mostly no “X_”Attributes available  for Your needed attributes.

     

    Because of Your Attribute-Wishlist, the SrmDbAPI wouldn´t be a better choise.

    Since version 9.1 or 9.2 there is a special User defined in the Spectrum Report Manager Database. This could be used as an API and is called SRMDBAPI. .. well documented *-)

     

    Please let me know, how much faster the script runs without External Attributes.

     

    Take care, we run into some problems with 9.2.3 or 9.3 while we used XML-Comments.

    Some of our scripts didn´t work ,-> without any error.

    After deleting all comments, it worked fine .

     

    Best Regards

    Erich

     

     

     

     

     

    Von: AndreySm

    Gesendet: Montag, 25. August 2014 14:56

    An: Heinemann, Erich

    Betreff: Re:  - CA Spectrum REST WEB API speed...why it's so slow?

     

    CA Communities <https://communities.ca.com/?et=watches.email.thread>

     

     

    CA Spectrum REST WEB API speed...why it's so slow?

     

    reply from AndreySm<https://communities.ca.com/people/AndreySm?et=watches.email.thread> in CA Infrastructure Management - View the full discussion<https://communities.ca.com/message/241702916?et=watches.email.thread#241702916>



  • 8.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 25, 2014 05:00 PM

    Erich,

     

    Thank you very much for your point. 

     

    I have substituted all the attributes that had "E" for those that don't have "E". Apparently, this is not enough and it is still slow.

     

    I am  going to play with different attributes tomorrow and will let you know the results.

     

     

    Just in case, here is the part of XML I have changed (and it's  still slow for me  ):

     

     

    --------------------------------------------------------------

    ...

     

    <rs:requested-attribute id="0x1006e" /> <!-- Model Name  -->

      <rs:requested-attribute id="0x10032" /> <!-- Manufacturer  -->

      <rs:requested-attribute id="0x12a1f" /> <!-- ComponentNickName  -->

        <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

      <rs:requested-attribute id="0x12dbb" /> <!-- IP Address  -->

      <rs:requested-attribute id="0x5b6000e" /> <!-- USMPortAdminStatus  -->

      <rs:requested-attribute id="0x11ac8" /> <!-- RPOperStatus  -->

      <rs:requested-attribute id="0x230017" /> <!-- Description  -->

      <rs:requested-attribute id="0x11f82" /> <!-- Internal_If_Alias -->

      <rs:requested-attribute id="0x12bb3" /> <!-- PortSpeed  -->

      <rs:requested-attribute id="0x12dfa" /> <!-- X_IfType -->

     

     

    ...

    ------------------------------------------------------------------------------------



  • 9.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 25, 2014 06:59 PM

    Hi

    ,

    the last point You could change, - a) try to reduce the amount of interfaces by filtering or b) use the reporting-Database.

     

    If You decide to use the SRM-DB and mysql, let me know. Tomorrow I probably could check for an MySQL-Statement which covers your request.

    But then, it is never actual. The asset-data will be updated only at around 7:00 CEST - once the day.

     

    Best Regards

    Erich

     

     

    Am 25.08.2014 um 23:00 schrieb AndreySm <communityadmin@communities-mail.ca.com<mailto:communityadmin@communities-mail.ca.com>>:

     

    CA Communities<https://communities.ca.com/?et=watches.email.thread>

     

    CA Spectrum REST WEB API speed...why it's so slow?

     

    reply from AndreySm<https://communities.ca.com/people/AndreySm?et=watches.email.thread> in CA Infrastructure Management - View the full discussion<https://communities.ca.com/message/241703035?et=watches.email.thread#241703035>



  • 10.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 25, 2014 08:06 PM

    Erich,

     

    I am definitely interested in any information how to get this report by different methods.  Please, advise any readings on the topic how to access SRM-DB and MySQL. Is this related to CA Spectrum product?



  • 11.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 11:01 AM

    Erich,

     

    As I found "reporting-Database" is related to Report Manager. That's what I am starting to read now. Any examples of SQL requests will be appreciated.

    Also, it's still not clear to me,why Spectrum needs to poll "E" attributes at the time of my request. This is extract from "Infrastructure Manager Model Type Editor guide"

    "External

    Indicates the attribute value is maintained outside of the SpectroSERVER and that update of the value is done either at a polling interval or upon user request."

     

    I don't want it polled "upon user request", I want the last value that was polled "at a polling interval ".

     

    Any thoughts on that?



  • 12.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 11:35 AM

    Hi,

    Your request is exactly a “user request“ where Spectrum has to poll for.

    RestFul-Request are still request ..  a request is a request… *-)

     

    Did my hint make Your Rest-Request a little bit faster or slower?

    Which version are You using? 9.3 – there is a performance-patch available but I haven´t tested it. .. only heard that there is something on the road.

     

    Back to reporting-db… which is located on one of Your-Oneclick-Servers. .. not on an extra Boxi-Server. *-)

    If there are more than one Reporting-DBs installation in your environment. Take the one with the biggest event-file. *-) this is the active one.

    Folder with the tables: /Specroot/win32app/Spectrum/mysql/data/reporting/ .. do not touch them !!

     

    .. You will find the credential for the user “root” very easy  and I won´t post them here.

    I recommend to use the user srmdbapi but for this user You have to grant more privileges.

     

    If You need access from another server, You have to grant access too.

    USE reporting;

    GRANT SELECT ON reporting.* TO ‘srmapi’@’ErichsLaptop.home.local’ identified by ‘read the manual’;

    GRANT SELECT, EXECUTE ON srmdbapi.* TO ‘srmapi’@’ErichsLaptop.home.local’ identified by ‘read the manual’;

    FLUSH PRIVILEGES;

     

    After a grant, it should work locally with the users root or srmdbapi but I recommend not to change many things!

    If You do not know, what You are doing in the database, then ask other admins.

     

    In the database, there is a table interfacemodel and table devicemodel.

    These are all tables in the reporting-DB:

     

    mysql> use reporting

    Database changed

    mysql> show tables;

    +



  • 13.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 01:05 PM

    Erich,

     

    Thanks for the information you have provided.

     

    We are using Spectrum 9.2.1.

     

    Right now I am running script that is accessing only six attributes, that all have "M", which is  "Memory".

     

    -----------------------------

    ...

    <rs:requested-attribute id="0x1006e" /> <!-- Model Name  -->

    <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

    <rs:requested-attribute id="0x12dbb" /> <!-- IP Address  -->

    <rs:requested-attribute id="0x10c44" /> <!-- ILink_Status -->

    <rs:requested-attribute id="0x11f82" /> <!-- Internal_If_Alias -->

    <rs:requested-attribute id="0x12dfa" /> <!-- X_IfType -->

     

    ------------------------------------------------------------------------------

     

    Here is the output below:

     

    >perl 8Rest.pl

    Local date and time: Tue Aug 26 11:51:30 2014

     

     

    ...

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=500&throttlesize=500

    ...

    Local date and time: Tue Aug 26 11:58:14 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=1000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:00:04 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=1500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:02:38 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=2000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:04:00 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=2500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:04:09 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=3000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:04:41 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=3500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:07:44 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=4000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:16:01 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=4500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:20:48 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=5000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:27:54 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=5500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:33:24 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=6000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:46:45 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=6500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:48:12 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=7000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 12:48:17 2014

     

     

    Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=7500&throttlesize=500

     

    ....etc..still running....

     

    ----------------------------------------------------------------------------

     

    I am printing local time after every request. As you can see it's quite sporadic and could take from 9 seconds up to 7 minutes between different portions of data.

     

     

    [UPDATE]

     

    When I was writing this post script had been finished, literally "running like a crazy" on last requests.:

     

    ..

    Local date and time: Tue Aug 26 12:59:14 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=8000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 13:00:04 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=8500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 13:00:42 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=9000&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 13:00:58 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=9500&throttlesize=500

     

     

    ...

    Local date and time: Tue Aug 26 13:01:25 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=10000&throttlesize=500

    ...

    Local date and time: Tue Aug 26 13:01:51 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=10500&throttlesize=500

    ...

    Local date and time: Tue Aug 26 13:02:31 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=11000&throttlesize=500

    ...

    Local date and time: Tue Aug 26 13:02:57 2014

     

     

      Now accessing  https://spectrumserver.local/spectrum/restful/models?id=6dee194d-0232-4f9e-b5ca-cd590f61ad30&start=11500&throttlesize=500

    ...

    Local date and time: Tue Aug 26 13:03:11 2014

     

     

    Local time is: Tue Aug 26 13:03:11 2014

       Script has been finished. Results are in the SpectrumPorts.csv  file



  • 14.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 01:51 PM

    And what is interesting...I run the same script second time and it finished as a whole in 12 minutes (the first run was more than an hour).

    . It looks like a first run refreshed all "M" attributes in memory and now it's faster.



  • 15.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 02:30 PM

    Have You got all SQL-Statements via Email? Or were they truncated like in Jive?

     

    Regards

    Erich

     

    Von meinem iPhone gesendet

     

    Am 26.08.2014 um 19:51 schrieb "AndreySm" <communityadmin@communities-mail.ca.com<mailto:communityadmin@communities-mail.ca.com>>:

     

    CA Communities <https://communities.ca.com/?et=watches.email.thread>

     

    CA Spectrum REST WEB API speed...why it's so slow?

     

    reply from AndreySm<https://communities.ca.com/people/AndreySm?et=watches.email.thread> in CA Infrastructure Management - View the full discussion<https://communities.ca.com/message/241703340?et=watches.email.thread#241703340>



  • 16.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 03:02 PM

    Erich,

     

    There is no emails from you



  • 17.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 27, 2014 04:31 AM

    Hi,

    If You need informations, please send me Your email-Address, the last of my emails was truncated by the Community-Tool.

     

    .. You will find the credential for the user “root” very easy  and I won´t post them here.

    I recommend to use the user srmdbapi but for this user You have to grant more privileges.

     

    If You need access from another server, You have to grant access too.

    USE reporting;

    mysql> GRANT SELECT ON reporting.* TO ‘srmapi’@’ErichsLaptop.home.local’ identified by ‘read the manual’;

    mysql> GRANT SELECT, EXECUTE ON srmdbapi.* TO ‘srmapi’@’ErichsLaptop.home.local’ identified by ‘read the manual’;

    mysql> FLUSH PRIVILEGES;

     

    Then You should be able to connect to the Reporting-DB with the user root or srmapi.

    Switch to the right database via

    mysql>  Use reporting

     

    Here is a “final” SQL-Statement to fetch all interfaces via Reporting-DB:

     

    mysql> select i.model_name as interfacename, i.ifAlias ,  i.if_speed , i.port_type, d.model_name, d.ip as deviceip, d.mac, d.sys_desc as devicemac

    from devicemodel d, interfacemodel i  where i.device_model_key = d.model_key

    and d.destroy_time is null

    and i.destroy_time is null

    ;

     

    Check the existing columns/attributes of the used tables with:

    mysql> desc devicemodel;

    mysql> desc interfacemodel;

     

    Best Regards

    Erich

     

     

     

    Von: AndreySm

    Gesendet: Dienstag, 26. August 2014 21:03

    An: Heinemann, Erich

    Betreff: Re:  - CA Spectrum REST WEB API speed...why it's so slow?

     

    CA Communities <https://communities.ca.com/?et=watches.email.thread>

     

     

    CA Spectrum REST WEB API speed...why it's so slow?

     

    reply from AndreySm<https://communities.ca.com/people/AndreySm?et=watches.email.thread> in CA Infrastructure Management - View the full discussion<https://communities.ca.com/message/241703349?et=watches.email.thread#241703349>



  • 18.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 27, 2014 09:05 AM

    Erich,

     

    I can't send you anything, so I will post my email here: ...

     

    [UPDATE} As long as email address has been read by recipient, I have removed it from the post.



  • 19.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 27, 2014 02:19 PM

    This is a public place to share info. I don't think it's intended to be shared between 2 people and then deleted. Please only post stuff that is helpful to all. How are others meant to help with a post with {I have removed it from the post}?



  • 20.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 27, 2014 03:50 PM

    @franktonjes

     

    I was trying to find the way to send my email address to  Erich and there was no easy ways.. So, I  published it here for him  and when he replied to my email, I deleted the address.  I just didn't want my email to stay in public forum forever, then indexed by Google and accessed by spammers. It was only email address deleted, not an information , relevant to the discussion.

    Sorry about that, anyway.



  • 21.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 28, 2014 03:40 AM

    Hi AndreySm. Just to make you aware of this, there is a way to have a private conversation without following eachother first (or friending, whatever you want to call it) to be able to send a private message. When you start a new discussion you can select "Specific People" instead of "In a Place". If you add the person there, they will see the discussion in their inbox.



  • 22.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 26, 2014 02:30 PM

    Hi,

    Yes

     

    Sorry,

    Some attribtes are updated while polling the defined trhedsholds and status.

    In the past I only polled a couple of interfaces via Corba and defined thresholds to keep them up to date.

    ... I had tested to poll Interfaces via Spectrum and stored the Statistic in eHealth.. Far away from the focussed product-design.

     

    Perhaos it makes sence anyway to define a simple threshold like minor alarm by 99% utilization for 300 seconds by 5 minute polling.

     

    Then the acript should always run faster.

     

    Regards

    Erich

     

    Von meinem iPhone gesendet

     

    Am 26.08.2014 um 19:51 schrieb "AndreySm" <communityadmin@communities-mail.ca.com<mailto:communityadmin@communities-mail.ca.com>>:

     

    CA Communities <https://communities.ca.com/?et=watches.email.thread>

     

    CA Spectrum REST WEB API speed...why it's so slow?

     

    reply from AndreySm<https://communities.ca.com/people/AndreySm?et=watches.email.thread> in CA Infrastructure Management - View the full discussion<https://communities.ca.com/message/241703340?et=watches.email.thread#241703340>



  • 23.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 28, 2014 12:46 PM

    @MichielHelder Thanks for information.

     

    I would like to finish this discussion with my finding: this attribute was making my last request quite slow:

     

    <rs:requested-attribute id="0x230017" /> <!-- Description  -->


    When I got rid of it, I was able to get more or less stable results, like all 11 000 ports in  15 minutes. My latest working XML is:

    ----------------------

    <?xml version="1.0" encoding="UTF-8"?>

    <rs:model-request throttlesize="500"

      xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd ">

     

        <rs:target-models>

         <rs:models-search>

     

      <rs:search-criteria >

           <filter:filtered-models xmlns:filter="http://www.ca.com/spectrum/restful/schema/filter">

                <filter:equals>

                     <filter:attribute id="0x10000">

                          <filter:value>Gen_IF_Port</filter:value>

                     </filter:attribute>

                </filter:equals>

           </filter:filtered-models>

      </rs:search-criteria>

     

     

         </rs:models-search>

        </rs:target-models>

     

     

      <rs:requested-attribute id="0x1006e" /> <!-- Model Name  -->

      <rs:requested-attribute id="0x10032" /> <!-- Manufacturer  -->

      <rs:requested-attribute id="0x12a1f" /> <!-- ComponentNickName  -->

      <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

      <rs:requested-attribute id="0x5b6000e" /> <!-- USMPortAdminStatus  -->

      <rs:requested-attribute id="0x11ac8" /> <!-- RPOperStatus  -->

      <rs:requested-attribute id="0x129e0" /> <!-- HWComponentDescription  -->

      <rs:requested-attribute id="0x11f82" /> <!-- Internal_If_Alias -->

      <rs:requested-attribute id="0x12bb3" /> <!-- PortSpeed  -->

      <rs:requested-attribute id="0x12dfa" /> <!-- X_IfType -->

     

     

    </rs:model-request>

    -------------------------------------



  • 24.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 29, 2014 04:39 AM

    I’m not sure why you were querying that attribute. That looks like the ‘show version’ of the device.

    For the description of the interface, you should be querying the ‘ifDescr’ attribute (0x1134b).

     

    If you look at the length of the ‘Description’ attribute, it is very long and the same for all interfaces (at least in the examples I checked).

    This is one of those attributes that seem to be ‘misplaced’ (it seems to be more of a device attribute than a port/interface attribute!).

     

    You could use the ‘Description’ attribute on the device model itself in 1 call and copy it if you really needed it for interface processing reasons.

     

    Try adding the attribute above and see if that is what you were looking for!

     

    Regards,

     

    Frank



  • 25.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 29, 2014 05:13 AM

    Hi Frank,

    ‘ifDescr’ is an external attribute, - it would be polled in the moment oft he Rest-Quesry and will slow down the query. *-)

     

    Try it!

     

    Best Regards

    Erich

     

    Von: franktonjes

    Gesendet: Freitag, 29. August 2014 10:40

    An: Heinemann, Erich

    Betreff: Re:  - CA Spectrum REST WEB API speed...why it's so slow?

     

    CA Communities <https://communities.ca.com/?et=watches.email.thread>

     

     

    CA Spectrum REST WEB API speed...why it's so slow?

     

    reply from franktonjes<https://communities.ca.com/people/franktonjes?et=watches.email.thread> in CA Infrastructure Management - View the full discussion<https://communities.ca.com/message/241704000?et=watches.email.thread#241704000>



  • 26.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 29, 2014 05:57 AM

    Yes, this is true - but he is already querying ifAlias, so this wouldn't make such a big difference.

     

    You make a good point though, if you specify attributes that are external your queries can take a log longer. Sometimes this is unavoidable if you need to perform some actions based on these attributes.

     

    I think the problem with his queries taking so long is the vast amount of text that is being sent because of attribute '0x230017' for so many interfaces per device. The fact that he removed this and his queries got so much quicker shows this might be the case.

     

    I also think he probably intended to query the ifDescr attribute rather than the 'Description' one!



  • 27.  Re: CA Spectrum REST WEB API speed...why it's so slow?

    Posted Aug 29, 2014 09:11 AM

    @franktonjes  To make it more clear to you:

     

    As you can see at the beginning of this thread, I tried to query those attributes:

     

    <rs:requested-attribute id="0x11f6f" /> <!-- ifName  -->

      <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

    <rs:requested-attribute id="0x12dbb" /> <!-- IP Address  -->

      <rs:requested-attribute id="0x10e3f" /> <!-- ifAdminStatus  -->

      <rs:requested-attribute id="0x10e40" /> <!-- ifOperStatus  -->

      <rs:requested-attribute id="0x1134b" /> <!-- ifDesc  -->

      <rs:requested-attribute id="0x11f7e" /> <!-- ifAlias  -->

       <rs:requested-attribute id="0x11f6b" /> <!-- ifHighSpeed  -->

      <rs:requested-attribute id="0x1134c" /> <!-- ifType -->

     

    and it was very slow....

     

    Erich, advised to me to get rid of all attributes with "E" flag.  That what I did, and changed my query to this:

     

    <rs:requested-attribute id="0x1006e" /> <!-- Model Name  -->

      <rs:requested-attribute id="0x10032" /> <!-- Manufacturer  -->

      <rs:requested-attribute id="0x12a1f" /> <!-- ComponentNickName  -->

        <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

      <rs:requested-attribute id="0x12dbb" /> <!-- IP Address  -->

      <rs:requested-attribute id="0x5b6000e" /> <!-- USMPortAdminStatus  -->

      <rs:requested-attribute id="0x11ac8" /> <!-- RPOperStatus  -->

      <rs:requested-attribute id="0x230017" /> <!-- Description  -->

      <rs:requested-attribute id="0x11f82" /> <!-- Internal_If_Alias -->

      <rs:requested-attribute id="0x12bb3" /> <!-- PortSpeed  -->

      <rs:requested-attribute id="0x12dfa" /> <!-- X_IfType -->

     

    I didn't want 0x230017 (Description) specifically. I was trying to find something instead of 0x1134b (ifDesc) that was not "External". And it was still very slow, apparently because of this one 0x230017 attribute.

     

    Finally, I have changed it (0x230017 ) to 0x129e0 (HWComponentDescription  ) and it started working fast enough:


    <rs:requested-attribute id="0x1006e" /> <!-- Model Name  -->

      <rs:requested-attribute id="0x10032" /> <!-- Manufacturer  -->

      <rs:requested-attribute id="0x12a1f" /> <!-- ComponentNickName  -->

      <rs:requested-attribute id="0x12d7f" /> <!-- Network Address  -->

      <rs:requested-attribute id="0x5b6000e" /> <!-- USMPortAdminStatus  -->

      <rs:requested-attribute id="0x11ac8" /> <!-- RPOperStatus  -->

      <rs:requested-attribute id="0x129e0" /> <!-- HWComponentDescription  -->

      <rs:requested-attribute id="0x11f82" /> <!-- Internal_If_Alias -->

      <rs:requested-attribute id="0x12bb3" /> <!-- PortSpeed  -->

      <rs:requested-attribute id="0x12dfa" /> <!-- X_IfType -->