GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: my socket is very slow in the hp-ux 11.00, why...
Operating System - HP-UX
1855929
Members
12279
Online
104107
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
back
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
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
02-25-2002 01:08 AM
02-25-2002 01:08 AM
my socket is very slow in the hp-ux 11.00, why?
the server program and client program is very simple. the following is part of program.
/*server.c*/
int main(void)
{
socket(AF_INET, SOCK_STREAM, 0))
setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int))
bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)
listen(sockfd, BACKLOG) == -1)
while(1)
{
accept(sockfd, (struct sockaddr *)&their_addr, &sin_size)) ==
-1)
if (!fork())
{
// this is the child process
close(sockfd); // child doesn????t need the listener
send(new_fd, "Hello, world!\n", 14, 0) == -1)
exit(0);
}
close(new_fd); // parent doesn????t need this
}
return 0;
}
/*client.c/
int main(int argc, char *argv[])
{
gethostbyname(argv[1])) == NULL)
socket(AF_INET, SOCK_STREAM, 0))
connect(sockfd, (struct sockaddr *)&their_addr,sizeof(struct
sockaddr))
recv(sockfd, buf, MAXDATASIZE-1, 0) /*slow function*/
close(sockfd);
}
this client and server works very well in the linux, but if the server
is in the hp-ux, client is in the linux, it is very slow, the time of
recv() function in the client is about 10 times longer than in linux.
If both client and server are in Hp-ux, it is much slower.
Is there some problem in my HP-UX?
hope anybody help me.
thanks
Yu
/*server.c*/
int main(void)
{
socket(AF_INET, SOCK_STREAM, 0))
setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int))
bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)
listen(sockfd, BACKLOG) == -1)
while(1)
{
accept(sockfd, (struct sockaddr *)&their_addr, &sin_size)) ==
-1)
if (!fork())
{
// this is the child process
close(sockfd); // child doesn????t need the listener
send(new_fd, "Hello, world!\n", 14, 0) == -1)
exit(0);
}
close(new_fd); // parent doesn????t need this
}
return 0;
}
/*client.c/
int main(int argc, char *argv[])
{
gethostbyname(argv[1])) == NULL)
socket(AF_INET, SOCK_STREAM, 0))
connect(sockfd, (struct sockaddr *)&their_addr,sizeof(struct
sockaddr))
recv(sockfd, buf, MAXDATASIZE-1, 0) /*slow function*/
close(sockfd);
}
this client and server works very well in the linux, but if the server
is in the hp-ux, client is in the linux, it is very slow, the time of
recv() function in the client is about 10 times longer than in linux.
If both client and server are in Hp-ux, it is much slower.
Is there some problem in my HP-UX?
hope anybody help me.
thanks
Yu
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2002 02:15 AM
02-25-2002 02:15 AM
Re: my socket is very slow in the hp-ux 11.00, why?
Hi,
First, check that your gethostbyname on your client is able to resolve the host to IP address properly ie. check your /etc/nsswitch.conf, /etc/resolv.conf and /etc/hosts (whichever is applicable based on your name service switches).
Second, check your network performance between your client and server using tools such as iperf described at http://dast.nlanr.net/Projects/Iperf/
The gzipped tarball can be downloaded from:
http://dast.nlanr.net/Projects/Iperf/iperf-1.2.tar.gz
It allows you to test TCP/UDP socket throughput.
Third, if your findings have been verified (ie. that HP-UX is slower), check your TCP tunable parameters using ndd
# ndd -get /dev/tcp ...
In particular, check out the following TCP network parameters:
tcp_xmit_hiwater_def (read and write)
tcp_xmit_lowater_def (read and write)
tcp_recv_hiwater_def (read and write)
tcp_xmit_hiwater_lfp (read and write)
tcp_xmit_lowater_lfp (read and write)
tcp_recv_hiwater_lfp (read and write)
tcp_xmit_hiwater_lnp (read and write)
tcp_xmit_lowater_lnp (read and write)
tcp_recv_hiwater_lnp (read and write)
Hope this helps. Regards.
Steven Sim Kok Leong
First, check that your gethostbyname on your client is able to resolve the host to IP address properly ie. check your /etc/nsswitch.conf, /etc/resolv.conf and /etc/hosts (whichever is applicable based on your name service switches).
Second, check your network performance between your client and server using tools such as iperf described at http://dast.nlanr.net/Projects/Iperf/
The gzipped tarball can be downloaded from:
http://dast.nlanr.net/Projects/Iperf/iperf-1.2.tar.gz
It allows you to test TCP/UDP socket throughput.
Third, if your findings have been verified (ie. that HP-UX is slower), check your TCP tunable parameters using ndd
# ndd -get /dev/tcp ...
In particular, check out the following TCP network parameters:
tcp_xmit_hiwater_def (read and write)
tcp_xmit_lowater_def (read and write)
tcp_recv_hiwater_def (read and write)
tcp_xmit_hiwater_lfp (read and write)
tcp_xmit_lowater_lfp (read and write)
tcp_recv_hiwater_lfp (read and write)
tcp_xmit_hiwater_lnp (read and write)
tcp_xmit_lowater_lnp (read and write)
tcp_recv_hiwater_lnp (read and write)
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2002 04:12 AM
02-25-2002 04:12 AM
Re: my socket is very slow in the hp-ux 11.00, why?
Hi,Steven,
Thank your reply. My gethostbyname() function is very fast, and the network persofrmance is good. So I use ndd to check the tunable paramters. But I don't know how to use ndd to set the paramters, for example I don't know the correct value of tcp_xmit_hiwater_def. Can you tell me how to use ndd?
thanks
Yu
Thank your reply. My gethostbyname() function is very fast, and the network persofrmance is good. So I use ndd to check the tunable paramters. But I don't know how to use ndd to set the paramters, for example I don't know the correct value of tcp_xmit_hiwater_def. Can you tell me how to use ndd?
thanks
Yu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2002 04:40 AM
02-25-2002 04:40 AM
Re: my socket is very slow in the hp-ux 11.00, why?
Yu,
The first thing to do is to make sure your system is up to date with patches. You should have at least the Dec 2001 patch bundle installed, and then using the custom patch manager determine what other pathces are necessary/suggested.
live free or die
harry
The first thing to do is to make sure your system is up to date with patches. You should have at least the Dec 2001 patch bundle installed, and then using the custom patch manager determine what other pathces are necessary/suggested.
live free or die
harry
Live Free or Die
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP