Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Queries to Amazon Web Service take ages

by svetho (Beadle)
on Mar 30, 2005 at 10:32 UTC ( #443398=perlquestion: print w/replies, xml ) Need Help??

svetho has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed Monks

I have written a script to query the Amazon Web Service. I use Net::Amazon to process requests but particularly searching for a keyword takes exceptionally long. My script calls a subroutine that looks like this:

sub search4Keyword { my $keyword = shift; my $request = Net::Amazon::Request::Keyword->new ( keyword => $keyword, mode => 'books', ); my $response = $ua->request ($request); $response; }
This can sometimes take more than a minute, though I experienced that searching for an ASIN is usually quicker. Does any of you experience similar problems and does anyone have a solution?

Replies are listed 'Best First'.
Re: Queries to Amazon Web Service take ages
by jhourcle (Prior) on Mar 30, 2005 at 12:31 UTC

    Sometimes other servers are just slow. You can try to decompose what they're doing, and try to see if it's the network between you and the webservice.

    And when you're dealing with databases, searches against some fields are faster than other fields. This doesn't surprise me at all.

    It's also possible that you caught them at a degraded period of time. (I don't know their setup, but they might've broken a mirror, so they could back up from a consistent point in time). They could've also had a failure that they were in the process of recovering from.

    A quick search on Amazon Web Service suggests that they made changes last week.

      Thanks for your reply. I thought there might be a reason in my code or maybe in one of the modules that I might be able to fix myself because requests that take longer than one minute (and not just occasionly but most of the time) did seem a little too slow to me (after all I usually get my results right away when I type in a search term directly on the site).
      Then again, it's not something that does any sort of harm it's just a little irritating at times.
      Any road, thanks for your response.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://443398]
Approved by rob_au
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-10-26 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (254 votes). Check out past polls.

    Notices?