in reply to So is this a kernel limitation, a hardware limitation, or a perl limitation?

Whenever you compile a program under Un*x, you have four potential RAM limitations: It is entirely possible that you are using up the memory that was allowed for Perl to use and that Perl was compiled with a too-low-for-you mem limitation. If it is an option, you might try recompiling Perl with the -dm option to request what this compile-time limitation is. You say your system maxes out at 65 iterations. Why not fire up 10 iterations or even 1 iteration and first make sure that (1)Your code works as you request (2) and there are no memory leaks before fooling around with Perl's internals.

Also, it looks to me like your program could benefit from threads if dacts() is forking off Napster clients. Unfortunately, threads are in pretty poor shape in Perl. Click here to see why. A C program with an embedded Perl interpreter might help you initialize and get you ready to run but the threads would heavily cut down on memory usage by those clients. If dacts() does not fork than you are confused because you use terms like "threaded" and "spawn" and thus make this paragraph null. Though, as tilly mentions, no one can imagine what dacts() does, if your system is coming to a halt, then I imagine that a large amount of processes are being forked. Another thing to ask yourself, also, is: Do I need so many Napster clients?

AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
  • Comment on Re: So is this a kernel limitation, a hardware limitation, or a perl limitation?

Replies are listed 'Best First'.
Re: Re: So is this a kernel limitation, a hardware limitation, or a perl limitation?
by deprecated (Priest) on Jan 19, 2001 at 04:27 UTC
    By Popular Request, the dacts() function:
    sub dacts { my ($un, $pwd, $srvr, $port) = @_; my $r; my $n; warn qq-attempting $srvr:$port- if $DEBUG; $r = $n = MP3::Napster -> new ( qq-$srvr:$port- ); if ($r) { warn qq-connected to server\n- if $DEBUG } else { warn qq- +never connected to $srvr:$port- ; return } warn qq-username: $un | password: $pwd-; $n -> my_login ( $un, $pwd, qq-ralphnap-, LINK_UNKNOWN, 8899 ); if (!$n) { warn qq-could not log in to server $srvr : $! \n $@- ; +return } warn qq-logged in okay...\n- if $DEBUG; return $n; 1 }

    and, while i appreciate it, AgentM, I of course ran it with one instance, and it works. It is working fine as I write this, with 60 connections up (and netscape and an opennap server and zillions of rxvt's. When I say that it doesnt fork(), I mean that one process is running. It is my understanding from perldoc -f fork ...

    Does a fork(2) system call to create a new process running the same program at the same point. It returns the child pid to the parent process, C<0> to the child process, or C<undef> if the fork is unsuccessful. File descriptors (and sometimes locks on those descript +ors)
    actually spawns a new process. The amount of memory actually used in this case is pretty slim compared to what most would expect:
    MemTotal: 189248 kB MemFree: 7540 kB SwapTotal: 393156 kB SwapFree: 380144 kB
    So I think I have concluded here that memory is not the issue, unless something else is coming up that I'm missing.

    --
    i am not cool enough to have a signature.

      You are running out of handles somewhere. Since 65 is really close to a magic number (2**6 == 64) I'd bet that all those connections to the network are hitting a limit.

      --
      $you = new YOU;
      honk() if $you->love(perl)

Re: Re: So is this a kernel limitation, a hardware limitation, or a perl limitation?
by deprecated (Priest) on Jan 21, 2001 at 04:42 UTC
    Hi, all. I just wanted to follow up on this post since it seemed to have a few people (or at least me) stumped. Well, I had to reboot the system for some maintenance, and I was then able to open over 2,000 connections with a modest 40MB of RAM. Clearly whatever the problem was, it was a software issue that was eluding me. All is well now. :)

    thanks to all who responded.
    dep

    --
    i am not cool enough to have a signature.