[ 
https://issues.apache.org/jira/browse/AMBARI-17376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15345100#comment-15345100
 ] 

Srimanth Gunturi commented on AMBARI-17376:
-------------------------------------------

Turns out that the default JSON library of Python2 is really slow - 
[http://artem.krylysov.com/blog/2015/09/29/benchmark-python-json-libraries/]
Multiple users have suggested 
[simplejson|https://pypi.python.org/pypi/simplejson/], which is also available 
in Centos base packages.

By switching to simplejson in stack-advisor (1 line change), the loadJson() 
calls went from ~1100ms to ~60ms.

*json times:*
{noformat}
loadJson(hosts):                1012    922     938     972     943
loadJson(services)              216     207     208     212     204
dumpJson():                     5       4       4       4       4
{noformat}
*simplejson times:*
{noformat}
loadJson(hosts):                53      52      55      56      53
loadJson(services)              11      11      12      11      11
dumpJson():                     2       2       2       2       2
{noformat}

A call which used to take ~3s now takes ~1s.

> Recommendations request execution takes too long time
> -----------------------------------------------------
>
>                 Key: AMBARI-17376
>                 URL: https://issues.apache.org/jira/browse/AMBARI-17376
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.4.0
>            Reporter: Srimanth Gunturi
>            Assignee: Srimanth Gunturi
>            Priority: Critical
>             Fix For: 2.4.0
>
>         Attachments: RecommendationsBreakdown.png
>
>
> /api/v1/stacks/HDP/versions/2.5/recommendations GET request is executed for a 
> long time. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to