- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- RPC program loops using 100% cpu
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 03:29 AM
04-19-2005 03:29 AM
RPC program loops using 100% cpu
When this happens the truss command reveals that the program is calling poll() continuously, I think (although I?m not sure) that all this happens when a client fails to connect for some reason.
Has anyone seen anything like this before? As our code is just calling svc_run() we have very little control over it?s behaviour at the point it is going wrong.
Aside issue is that the version of lsof we have doesn?t tell us anything about the TCP sockets in use by the process because of the transport-independence layer I guess.
It just reports open files of type tcpm->ip which is a bit frustrating. But ultimately fixing lsof isn?t my main problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 03:33 AM
04-19-2005 03:33 AM
Re: RPC program loops using 100% cpu
poll is a bit like select, it monitors file descriptors awaiting certain conditions. One of the arguments for poll is a timeout. If this is too low, then you will use a lot of CPU.
Do you have access to the source code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 04:10 AM
04-19-2005 04:10 AM
Re: RPC program loops using 100% cpu
I can tell your are itching to see the source; here is the relavent section...
if ((nconf = getnetconfigent("tcp")) == NULL)
[ snip error handling code here ]
if ((fd = t_open("/dev/tcp", O_RDWR, (struct t_info *) NULL)) < 0)
[ snip error handling code here ]
if (tli_set_reuseaddr(fd) == -1)
[ snip error handling code here ]
if ((bind = (struct t_bind *)t_alloc(fd, T_BIND, T_ADDR)) == NULL)
[ snip error handling code here ]
bind->qlen = 8;
bind->addr.len = sizeof(srv_addr);
bind->addr.buf = (char *)&srv_addr;
srv_addr.sin_family = AF_INET;
srv_addr.sin_addr.s_addr = INADDR_ANY;
srv_addr.sin_port = RASRPC_PORT;
if ((transp = svc_tli_create(fd, nconf, bind, 0, 0)) == NULL)
[ snip error handling code here ]
if (!svc_reg(transp, RAS_PROG, RAS_VERS, ras_prog_1, nconf))
[ snip error handling code here ]
if (nconf)
freenetconfigent(nconf);
svc_run();
/* NOTREACHED */
exit(-1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 07:12 AM
04-19-2005 07:12 AM
Re: RPC program loops using 100% cpu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 07:57 AM
04-19-2005 07:57 AM
Re: RPC program loops using 100% cpu
As you say maybe we need to re-code to call poll directly - but RPC meant to be easy isn't!?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 08:26 PM
04-19-2005 08:26 PM
Re: RPC program loops using 100% cpu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 08:52 PM
04-19-2005 08:52 PM
Re: RPC program loops using 100% cpu
poll(0x60000000001589a0, 43, -1) [sleeping]
From memory I think last time it went haywire it was returning something like:-
poll(????, 41, -1) = 1
poll(????, 41, -1) = 1
poll(????, 41, -1) = 1
poll(????, 41, -1) = 1
[ad infinitum]
Iâ m sure that I have also seen it returning 6 when looping as above. Next time it hammers the CPU Iâ ll confirm the return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2005 04:38 AM
04-20-2005 04:38 AM
Re: RPC program loops using 100% cpu
I suppose the usual song and dance about being up on the latest RPC and Transport patches would apply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2005 05:20 AM
04-21-2005 05:20 AM
Re: RPC program loops using 100% cpu
poll(0x60000000001589a0, 48, -1) = 1
ioctl(298, I_XTI_RCV, 0x9ffffffffffff4e0) ERR#5 EIO
ioctl(298, I_PEEK, 0x9ffffffffffff4a0) = 1
ioctl(298, I_PEEK, 0x9ffffffffffff490) = 1
getmsg(298, 0x9ffffffffffff3f0, NULL, 0x9ffffffffffff3e0) = 0
close(298) = 0
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
poll(0x60000000001589a0, 48, -1) = 1
Which seems to be on the shutdown or close of a client. The problem seems to be that the number of open files (sockets) hasn't gone down from 48 to 47 as I'd expect. And as it does when I try to repdrouce the problem on our development systems.
To answer your question. The program still works when it's looping on poll - so yes sometimes it calls other stuff. But it's calling poll so quickly and so often it appears to just be calling poll (and filling up the disk when I leave truss in trace mode).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2005 05:29 AM
04-21-2005 05:29 AM
Re: RPC program loops using 100% cpu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2005 09:22 AM
04-21-2005 09:22 AM
Re: RPC program loops using 100% cpu
poll(0x60000000001589a0, 31, -1) .............................................. = 4
poll[0].fd: 3
poll[0].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[0].revents: 0
poll[1].fd: 256
poll[1].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[1].revents: 0
poll[2].fd: 257
poll[2].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[2].revents: 0
poll[3].fd: 258
poll[3].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[3].revents: 0
poll[4].fd: 259
poll[4].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[4].revents: 0
poll[5].fd: 260
poll[5].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[5].revents: 0
poll[6].fd: 261
poll[6].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[6].revents: 0
poll[7].fd: 262
poll[7].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[7].revents: 0
poll[8].fd: 263
poll[8].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[8].revents: 0
poll[9].fd: 264
poll[9].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[9].revents: 0
poll[10].fd: 265
poll[10].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[10].revents: 0
poll[11].fd: 266
poll[11].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[11].revents: 0
poll[12].fd: 267
poll[12].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[12].revents: 0
poll[13].fd: 268
poll[13].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[13].revents: 0
poll[14].fd: 272
poll[14].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[14].revents: 0
poll[15].fd: 274
poll[15].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[15].revents: 0
poll[16].fd: 275
poll[16].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[16].revents: 0
poll[17].fd: 276
poll[17].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[17].revents: 0
poll[18].fd: 277
poll[18].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[18].revents: 0
poll[19].fd: 278
poll[19].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[19].revents: 0
poll[20].fd: 281
poll[20].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[20].revents: 0
poll[21].fd: 282
poll[21].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[21].revents: 0
poll[22].fd: 286
poll[22].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[22].revents: 0
poll[23].fd: 287
poll[23].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[23].revents: 0
poll[24].fd: 288
poll[24].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[24].revents: POLLNVAL
poll[25].fd: 289
poll[25].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[25].revents: 0
poll[26].fd: 290
poll[26].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[26].revents: POLLNVAL
poll[27].fd: 291
poll[27].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[27].revents: 0
poll[28].fd: 292
poll[28].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[28].revents: POLLNVAL
poll[29].fd: 293
poll[29].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[29].revents: POLLNVAL
poll[30].fd: 294
poll[30].events: POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND
poll[30].revents: 0
poll(0x60000000001589a0, 31, -1) .............................................. = 4
So it looks like the server currently has 4 connections returning POLLNVAL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2005 10:07 AM
04-21-2005 10:07 AM
Re: RPC program loops using 100% cpu
otherwise, (I'm not fully ONC RPC aware) it points at a possible hole in the application where it isn't removing something it should?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2005 10:32 AM
04-21-2005 10:32 AM
Re: RPC program loops using 100% cpu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2005 11:01 AM
04-21-2005 11:01 AM