Hi folks

UPDATE: Interesting. The REST calls I make require authentication. I get an authentication token and then make a 2nd call. I decided to cache the authentication token per thread (which worked - wasn't sure if it would for multiple successive calls) and it dropped *2 hrs* off the AIX run time. So, making the REST calls from AIX is definitely a source of the problem. Not sure why yet. Interestingly, doing the same on the Xeon Intel machine running Linux dropped the runtime to 52 mins from 1.5 hrs. So, not so much of an improvement but definitely better there too.

Kind regards

Derek

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

ORIGINAL QUESTION BELOW

Hi folks,

Skip to the bottom for the Q if you don't want the background here:

I have a mature robust multithreaded application that's been running in various guises and various UN*X flavors since 2008. I have just modified it to add some new features and run in a different way. The process can spawn up to several hundred threads at a time which remain running to multiplex and queue multiple parallel client inputs on multiprocessor machines.

In the new version, I hit an external website with a REST query rapidly - multiple times per second with several hundred clients talking to the server process threads sequentially - 20 at a time.

When I run this on an old Pentium D Dual core machine, it takes 2 hrs to run thru' all my clients. On a Xeon quad core, it's an hour and a half. The network response times do dominate a bit - I'm already aware of that. However, on AIX, the thing takes **4 hours** to complete! That.Should.Not.Happen! :-) The AIX machine is a multiprocessor workhorse with partitioning and 64G memory. It beats the pants off of the Xeon-based machine, and certainly the Pentium D machine.

So, - my Q is, why would this take so long on AIX? Is it a function of using threads on AIX? Something in the REST client libs? (Using REST::Client) something else odd that anyone is aware of on AIX? Remember - I've been using this software in one form or another on AIX for years (I wrote it - it's about 60k lines of code overall). Only noticed this problem because I had a comparison baseline with other systems on this particular instance of the server, and other uses of it didn't hit the problem. I'm thinking something in the net calls or something in the context switching among threads.

Corollary: I have a way to batch the REST query data. When I do that, on the Pentium D, the data set takes 18 mins (but is less accurate). When I batch it on AIX it takes *15* mins. Yes - right - so - something to do with networking or context switching. I'm pitching to networking.

Corollary 2: The Xeon machine is on the same internal network as the AIX machine. So, not a network connectivity problem per se.

Fellow Perl folks. Your help - as always - is much appreciated.

Kind regards, Derek


In reply to Multithreaded process on AIX slow by scunacc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.