Re: Cobol app takes 100% CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Frank

Frank Cox <theatre@xxxxxxxxxxx> writes:

> On Wed, 26 Mar 2008 09:55:20 -0300
> Rodrigo Real <rreal@xxxxxxxxxxxxx> wrote:
>
>> This cobol app always tried to eat the most of cpu it can, with 10 or
>> 12 users the situation were acceptable, but now with 26 it is been
>> very hard to work.
>
>
> Have you tried Tame?

I once took a look at Tame, but didn't tried it, since it was a paid
software and I didn't know anything about it, I just didn't pay
attention. But it is good to know that it works.

When you answered my question I was in the middle of a solution and
followed it until the end.

I decided to hack dosemu code to limit its cpu usage. I made some
tests that were very fine, and found a solution for me.

In the end I changed only two lines of code. In src/include/timers.h I
multiplied by 1000 the JIFFIE_TIME, so it became:

-#define JIFFIE_TIME            (1000000/sysconf(_SC_CLK_TCK))
+#define JIFFIE_TIME            (1000000000/sysconf(_SC_CLK_TCK))

And in src/base/bios/int16.c I added a usleep before
check_key_available call:

   case 0x11:
+    usleep(INT2F_IDLE_USECS/100000);
     check_key_available(EXTENDED);
     break;

Now the load of the server is less them one, even with 20 dosemu
processes running, before that changes the load would be in 12. And
the users are very happy with the performance.

Don't know if this is a good forum for that, but I guess that this
sort of thing should be a parameter, so users can calibrate their
speed. Maybe I am missing something, but I guess that many dosemu
users would be in a situation similar to mine.

Thanks for helping!

Cheers,
Rodrigo
--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Console]     [Linux Audio]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Camping]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Linux Media]     [Fedora Users]

  Powered by Linux