TCP/IP Communication Latency too big

I have a simple application sending 500 byte messages to a server and recieved the resoinse with the similar saize of message(for testing purpose we do not do any manupulation of the message. It is simple recieve and reply) . Both apps a Java, but I somehow see the roundtrip of 1,7 msec, wchich seems to be quite high for what it is doing.
one machine is LINUX REDHAT Ver4., and the other is SUN Opteron box with Solaris10. JDK1.6 is used.
Does anybody have any way to improve the latency at all?
By the way, the message is already sent and recieves using 'NO TCP DELAY' set on.
Thank you very much for your advaice.
H

Test programs below; around 0.7 ms for one way is what I get too. You have your network speed and your computers' ability process interrupts.
You may want to look into ways to bunch up several requests into one network packet. (Yeah, TCP/IP is not a packet protocol, but if you need to get the last bit of performance you may need to consider stuff like packet issues and NIC interrupts.) Do another test first: stream a few megabytes one way in large write sizes; that's your baseline upper limit for what you can transfer by bunching up requests and replies. In olden days this test would be done using FTP, but I guess FTP servers are getting less common for security reasons.
public class TimePingPongServer
    static final int SIZE = 500;
    public static void main(String args[])
     throws Exception
        ServerSocket serverSocket = new ServerSocket(6666);
     while (true) {
         System.out.println("waiting for connections");
         Socket socket = serverSocket.accept();
         System.out.println("got connection");
         OutputStream out = socket.getOutputStream();
         InputStream in = socket.getInputStream();
         int size = TimePingPongServer.SIZE;
         byte buf[] = new byte[size];
         while (true) {
          if (!readFully(in, buf, 0, TimePingPongServer.SIZE)) {
              System.out.println("got EOF");
              break;
          out.write(buf, 0, size);
         socket.close();
    public static boolean readFully(InputStream in, byte buf[], int pos, int len)
        throws IOException
        int got_total = 0;
        while (got_total < len) {
            int got = in.read(buf, pos + got_total, len - got_total);
            if (got == -1) {
                if (got_total == 0)
                    return false;
                throw new EOFException("FileUtil.readFully: end of file; expected " +
                                       len + " bytes, got only " + got_total);
            got_total += got;
        return true;
import java.net.*;
import java.io.*;
public class TimePingPongClient
    public static void main(String args[])
     throws Exception
     System.out.println("connecting");
     Socket socket = new Socket(args[0], 6666);
     socket.setTcpNoDelay(true);
     OutputStream out = socket.getOutputStream();
     InputStream in = socket.getInputStream();
     System.out.println("connected");
     int packets = 0;
     int modulo = 10000;
     long start = System.currentTimeMillis();
     byte buf[] = new byte[TimePingPongServer.SIZE];
     while (true) {
         out.write(buf);
         if (!TimePingPongServer.readFully(in, buf, 0, TimePingPongServer.SIZE)) {
          System.out.println("got EOF");
          break;
         if (++packets % modulo == 0) {
          long end = System.currentTimeMillis();
          long time = end - start;
          System.out.println(modulo + " pingpongs in " + time + " ms; " +
                       (2.0 * time / modulo) + " ms/message");
          if (packets % (modulo * 20) == 0) {
              socket.close();
              break;
          start = end;
}

Similar Messages

  • Recommended way to secure my TCP/IP Communication

    This may be basic, sorry, but I never had to worry about this.
    What is the recommended way to secure my TCP/IP communication?
    I will have a simple server listening on a TCP socket and servicing client requests. Unfortunately, the server must run at a site only accessible to the client via the internet. The client is a .NET (C#) application. Typically, I'd connect the 2 easily with standard sockets and be done. In this case, I must protect the information being transfered.
    What would you use? SSL? I am not too familiar on how to do this on the .NET end.

    A common way to secure communications over TCP is SSL, yes. If your question is "How do use SSL in my .NET client?" then perhaps you should seek a more appropriate forum.

  • Mail box font is TOO BIG (maverick OSX)

    hi:
    i sadly just upgraded to the new osX. all sorts of problems and as usual no simple chat to ask direct questions.
    even though i got it from app store.  no chat options are showing... for me. apparently they are suppose to.
    so maybe someone in the community can help me.
    the FONT on the mailbox panel + the message listing panel, are TOO BIG. and no matter what i do in the properties under font, it has no impact.
    the properities/font appears only to impact the email message itself.
    I need to change the FONT back to what it was before i upgraded to maverick OSX from snow leopard. its way too big.
    since upgrading to maverick OSX, the font in my browswer (firefox) is still OK. nothing apears to have changed.
    but in the apple mail app - A MESS.
    any clues?

    hi bee, thankyou for your trying to help, but unfortunately you missed a key word in my question. I am asking "mailbox" pane.
    your answer is for the 3rd pane, the email message itself. i have no issue with that. properties has not changed in teh upgrade to maverick OS.
    the 2nd pane (message listing) and 1st pane (listing of mailbox) HAS CHANGED in upgrade to maverick OSX.
    what i learnt from apple support is:
    pane 2: listing of what is in mailbox. -- was possible to change font in classic style. can continue to do this in maverick osx ONLY if you choose the option retain "classic style" under properties/view. else changing the setting in your screenshot has NO IMPACT in the new user interface.  so that in my book is bad coding. defect.
    pane 1: listing of mailbox -- not possible.  and got uglier in maverick OS as now the font is even bigger. plain ugly and needs to be retified. i have about 10 mailboxes so all my screenspace is gone with just the mailboxes and requires scrolling to folders. boring....

  • Applicatio​n windows too big

    The screen size of the desk top is fine. Every application you open - IE - WORD - EXCEL etc... is too big on the screen. How do you make the information smaller in windows 7 ??

    Hello Sherri123,
    Check your screen resolution to ensure it's properly set. Right click on an open area on your desktop and select screen resolution. The lower the screen resolution (such as 640 x 480) the bigger the programs will appear. You want a higher resolution such as 1024 x 768 to make them appear properly.
    If I have helped you in any way click the Kudos button to say Thanks.
    The community works together, click Accept as Solution on the post that solves your issue for other members of the community to benefit from the solution.
    - Friendship is magical.

  • Best Quality too big for DVD. need help

    Hi,
    I just completed a movie using iMovie. I compressed the movie as a Quicktime file at best quality and it is 6gb. I understand that this is too big for the 4.7gb dvd-r's i have.
    I wanted to know the best way to get my movie to fit while still mainting the best possible quality. This project is very important and i need it to be able to play on a home dvd player tomorrow.
    I'm using iDVD.
    Can somebody please help me out.
    Thank you so much

    Hi Karl,
    first of all: on this forum, my guess is, you are the one with the deepest insight in iMovie (one word: corrupted projects... oops, that was two).
    BUT...
    My job for more then 20 years is communication, advertisement as an example. make the message in less then 8 words...
    Apples says: 60/120 minutes of an iM project fit on a dvd-r.Full stop.
    that is from my p.o.v crystal-clear..HOW is this done? easy: make project, click "iDVD" - BOOM! done... to quote the CEO of a small computer company...
    people buy cars without ANY idea, what ABS, EPS, etc is, besides HOW it works. they use it. full stop. anyone any idea, what happens, when you push the pedal...? ... when the car DOESN'T accelerate, you realize, you have NO clue...-
    funny enough, this forum is CROWDED with people, who don't own a driver's license, but try to explain, the car manufacturer has done big bugs, lots of mistakes, should fix that & this.- you CAN use a car, to boil eggs, iron your shirts and create a painting... but THAT would need a better understanding of how a car works.
    topics which are/can not understood lead to what the behaviorism calls "superstitious behavior" - you do some really weird things, because you believe it has any effect....
    so, sometimes, less knowledge leeds to better results
    (from a communicator's point of view)
    I agree, maybe the "help" files should offer an "expert" mode....

  • Blank one page pdf too big

    Why is my blank (I have deleted the text) one page pdf so big, it's 440KB.
    It contains nothing.

    I have the same problem with documents that are not blank- under audit, everything is reasonable, except for huge overhead, which I cannot get rid of.  Tried all the techniques under help.
    Jeffry Calhoun
    Workforce Analytics Manager
    Ohio Department of Job & Family Services
    P.O. Box 1618, Columbus, OH 43216-1618
    InterAgency: F376, 4020 E. 5th Avenue
    614-644-0564
    Fax 614-728-5938
    [email protected]
    OhioMeansJobs.com -
    The next best thing to having an HR department.
    OhioMeansJobs.com -
    Ohio's premier website for connecting businesses and job seekers - quickly, easily, and for free!
    >>> "Bill@VT" <[email protected]> 5/18/2012 11:04 AM >>>
    Re: Blank one page pdf too big created by Bill@VT ( http://forums.adobe.com/people/Bill%40VT ) in Creating, Editing & Exporting PDFs - View the full discussion ( http://forums.adobe.com/message/4419418#4419418 )
    Don't know what is going on. All of the size is in what is called the Document Overhead. I have not found anyway to remove that aspect. Bill
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4419418#4419418
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4419418#4419418. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Creating, Editing & Exporting PDFs by email ( mailto:discussions-community-acrobat-creating__editing_%[email protected] ) or at Adobe Forums ( http://forums.adobe.com/choose-container!input.jspa?contentType=1&containerType=14&contain er=4697 )
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.
    Ohio Means Jobs
    You're looking for something unique. Use more than an ordinary site.
    http://www.ohiomeansjobs.com
    This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain private, confidential, and/or privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, employee, or agent responsible for delivering this message, please contact the sender by reply e-mail and destroy all copies of the original e-mail message.

  • I need to downsize phots to publish on a website but they are too big . In help it says when I select a photo it gives me the option to downsize. It does NOT. ?

    I can't figure out how to downsize my photos for a website that won't take anything above 3MB my Photos are 4MB. Even when I send them in an email, they are too big to send more than 3 at a time and I don't know how to fix it! Help says that when I select a photo it gives me the option to downsize. It does NOT?????

    This is the iPhoto for iOS forum. Are you asking about iPhoto on your Mac?
    In iPhoto on your Mac select Export and you will have the option to select a size for your photo.
    In iPhoto for iOS this capability is not there. I use PhotoForege2 on my iPad to resize my photos to meet the requirements you describe.

  • Saving animated gif error - canvas size too big?

    Hi,
    i have been asked to create an animated gif which has a snow effect in the background. The animation runs pretty well using the pattern style to move the animated snow down. The problem is when I try to export the animation the save for web dialogue window freezes and I can't quit photoshop. I have tried to make the canvas (image size) smaller and it works.
    Is there a memory problem with creating animations in Photoshop if the document size is too big, im running a 3000x1000px at 72dpi
    TThe animation would be used on a web app, which a script could probably do a better job, but I need to try this first.
    thanks
    lister

    Something is very wrong here. The point behind using GIFs is that they are small and OK to put on a Web site.
    First thing: forget all about PPI - this has absolutely no relevance to Web/screen images; it is only used for printing. You need to think about the pixel size.
    So, how big in pixels are your starting images?
    How big do you want the resulting GIF to be? Again, you have to decide in pixels, as the viewing size will depend upon screen resolution of the person looking at it. You can use a notional PPI of 70-100 to guess how big it will be in inches, but that's all it is - a guess.
    Is this getting you going in the right direction?
    I cannot resist commenting that I hate almost all animated GIFs as they reduce Web site usability so much.

  • When I open my iPad the page is too big for the screen and won't shrink down. The keypad has also become very 'sticky'

    Recently when I open any apps the pages are too big for the screen. They shrink when pinched but immediately become bigger again. It's very difficult to scroll too. The keypad has become very sticky. Missing letters and spaces when I type and needing to tap the keys much harder than usual

    I have the exact same problem, I think.  I was on my iPad 3's home page swiping R-L to locate a certain icon when all of a sudden the screen appeared to get HUGE.  So big I could only see one or two icons.  I couldn't even turn it off to try a reboot because after I pushed the sleep/wake button, I couldn't find the red slide bar.  I finally just had to wait for the battery to die, then recharge it, and it looked normal again.  I also spoke with several friends who haven either iPads or iPhones, and they've all had this happen to them.  I checked my accessibility settings, and Zoom was already off.  So what is causing this problem for so many people, and what can we do to prevent it?  Please help.

  • Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Morning DeeHutton,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Best of luck,
    Mario

  • My homescreen won't resize and I can't access anything because everything is too big to navigate.  Help.

    My homescreen won't resize and I can't access anything because everything is too big to navigate.  Help.

    Double-tap the screen with three fingers to disable Zoom.
    To turn off Zoom go to Settings > General > Accessibility > Zoom and turn this Off.

  • When doing a second "Organize Library" cuz the first was too big, will iTunes recognize what's already copied over?

    I'm stuck with a large folder of music on my PC in My Music folder. And I used "Organize Library" in iTunes but it didn't copy everything over because the amount of music was too big. I've deleted the original copies of music outside of iTunes to open up more space and was wondering if I do a second "Organize Library" if it will recognize that some of the music has already been copied over.

    I don't know what "restore the iPod" is
    It's usually the second thing to do (after Reset) when the iPod is not working correctly.
    Select the iPod in iTunes and click Restore.
    See this -> Restoring iPod to factory settings
    what about my main question? Can I go back to "sync all" but manually block certain albums?
    No because sync all is just that.
    Sycning specific playlists should work fine. And you can create more than one and sync which ones you want.

  • I have my iTunes library on an external HD because it is too big for my iMAC 500GB HD. I want to backup my external HD. Can I do this with any Apple cloud product or should I look elsewhere? Also is it worth just buying another external HD to back up

    I have my iTunes library on an external HD because it is too big for my iMAC 500GB HD. However, it is not backed up, so I need a solution to backup my external HD. Can I do this with any Apple cloud product or should I look elsewhere for cloud products? Will it be cheaper/easier just to buy another external HD to back up my existing external HD? Thanks

    I don't know if this is me adding files to iTunes when the external wasn't connected
    it is.
    is it OK to just keep deleting that library on the Air?
    i wouldn't - at least not until i
    mount the external
    point iTunes media folder location back to the external via preferences > advanced
    consolidate my library via file > library > organize library
    The ntfs hasn't seem to be causing any problems, but I've always wanted to know.
    in order for your Mac to write to NTFS drives, it needs some help by installing e.g. the NTFS 3G driver. apparently that or something similar is installed on your Mac already. preferably, it would be formatted for Mac but then windows machines would need to have e.g. MacDrive installed to recognize the drive.

  • I recorded an interview on my iPad using the iTalk app. How can I transfer that audio to my MacBook Pro? The file is too big to email.

    I recorded an interview on my iPad using the iTalk app. How can I transfer that audio to my MacBook Pro? The file is too big to email.

    Use DropBox. https://www.dropbox.com/help/84/en
     Cheers, Tom

  • The "other" memory section on my Mac is WAY too big.

    Hey everyone!
    I know there are a LOT of discussions about this topic, but none of them really seemed to work for me. So the other day I got an error saying "Your startup disk is almost full". I immediately checked the storage section of "About my Mac", and sure enough, something like 100 GB were taken up by local backups. To fix this issue, I disabled local backups via this terminal command: sudo tmutil disablelocal.
    I did a restart and checked my storage again. This time, it looked like this (and still does):
    All of what used to be backups is now other. And the reason I have those 900 or so MB of backups is because I eventually turned those on again (with the reverse of the above command) in an effort to fix this. Out of options, I then went to the apple store, where they told me to just delete stuff that was too big. So I got a 1 TB drive and started copying and deleting stuff. The main thing I got rid of was a giant windows VM I had. And just to prove that something's wrong here, look at the breakdown of my files from OmniDiskSweeper:
    If you do the math, I should have about 100 GB more free than I do now. I've tried:
    Turning the thing off then on (you'd be surprised how often that works)
    Resetting the PRAM
    Forcing spotlight to reindex the machine
    Throwing the machine out the window (well, not quite)
    What I think might be the cause:
    This is a stab in the dark here, but possibly all those GB of backups tried to delete themselves and somehow corrupted and aren not called backups anymore by the system?
    Just one more thing: I noticed that OmniDiskSweeper showed a volume I don't recognize. It's called MobileBackups. Maybe that has something to do with it?
    I'll appreciate your help.
    Thanks!

    Although the guide is a little dated, a lot of the information there is really great and helps you track down a lot of files that are just taking up way too much space on your hard drive.
    http://pondini.org/OSX/DiskSpace.html
    I just did this the other day on my Air running 10.9 and recovered around 50GB of disk space, so there is potentially a lot you can do. I suggest following the steps on this guide (to the T, don't want to mess anything up) and go from there. Don't delete ANYTHING that you are not aware of the function, and remember that searching for names of files is a great way to determine whether or not you need it. Some files that SEEM like junk and take up a considerable amount of space are system files that will either be replaced the next time you boot up or render you computer useless entirely.
    For example, there is a file that saves the state of your computer just before it goes to sleep so that it can return quickly when you start up again, and that file is normally the size of the amount of RAM you have (I have 4GB of RAM, so the file was 4GB). After doing some research, this file will either be recreated if deleted, or your sleep mode will not be able to function properly if the file is deleted. So again, just tread lightly.
    Also, there is an application I used to get rid of a bunch of duplicate files that I had on my drive called Gemini (http://macpaw.com/gemini), which I recommend using to clean up documents. Again, be careful, you don't want to go deleting files that you are using that the application mistook for a duplicate.
    Hope this helps!

Maybe you are looking for

  • How to use selected row on another tab ?

    Hi, I created a table with a number of rows, containing a objectid and other stuff. When I select 1 or more rows and click a button, my application is doing his thing, and finally I got a message that all went fine. When I select another tab in that

  • Provisioning different User Type to different systems

    Dear Experts, Is there a way by which we can provision different user types to defferent systems via CUP? We have the following requirement: 1. User created in ECC should be dialog user 2. User created in BW should be service user 3. User always sele

  • JScrollPane containing JPanel HELP!

    Hi again, I'll try my luck again! Ok, I have a JPanel that uses a GridBagLayout with 3 columns and many rows. Each row is of the form: [JLabel][JTextField][JButton] Ok. Since I have many of these rows, and my application should be a constant size, I

  • INVOICE LAYOUT

    Hello Friends,       Currently Im doing INVOICE(domestic and export) LAYOUT script. Please tell me how to capture and display header text fields in billing document(VFO3) and also tell me that table name and field names. Thanks in advance. MohanKumar

  • TS1424 Impassable security questionnaire

    When trying to download songs Itunes store opens up a window with a list of 3 choices of questions, and a year of birth filled that has to be filled in to update security info. I fill this in but regardless of the comination of  questions answered  i