Speed Of Multi Threaded Non Socket Application

10 replies
If I had an application that was a content generator and was generating millions of pages for 1000 websites lets say. If I were to make it multi threaded would it be any faster. The reason Im asking is because an application that connects to the internet with many threads would be faster because many threads are established and then many TCP/IP requests are sent and received. If there was only one thread then there is a wait time for a request to come back. In this time other requests could be sent and/or handled. But in an application that is all local is there any benefit to multi threading.
#application #multi #socket #speed #threaded
  • Profile picture of the author WF99
    Nope .. I dont think so ..
    {{ DiscussionBoard.errors[5942875].message }}
    • Profile picture of the author michael_gourlay
      I would think that if the computer you were running it on had multiple cpu cores you would notice an increase in performance.
      {{ DiscussionBoard.errors[5943952].message }}
      • Profile picture of the author phpg
        If you have 1000 sites hosted on e.g. 10 servers, and need to update 1000 pages on each site, the best way would be to pack all updates for each server into a single file, upload it, and make the server unpack updates and do all required processing for every site stored on that server locally.

        If it's all local, generally multi-threaded application would be faster, but would consume more server resources. However there are many small details, and it depends on your particular implementation of multi-threading.
        {{ DiscussionBoard.errors[5944094].message }}
        • Profile picture of the author misha7878
          Originally Posted by phpg View Post

          If you have 1000 sites hosted on e.g. 10 servers, and need to update 1000 pages on each site, the best way would be to pack all updates for each server into a single file, upload it, and make the server unpack updates and do all required processing for every site stored on that server locally.

          If it's all local, generally multi-threaded application would be faster, but would consume more server resources. However there are many small details, and it depends on your particular implementation of multi-threading.
          Is there anyway to make sure that it gets unpacked on any ftp server. Like hostgator for example. All this without running some script.
          {{ DiscussionBoard.errors[5944904].message }}
  • Profile picture of the author phpg
    No, you'll need some sort of a script running on the server anyway.
    {{ DiscussionBoard.errors[5945140].message }}
    • Profile picture of the author misha7878
      Originally Posted by phpg View Post

      No, you'll need some sort of a script running on the server anyway.
      Is there any script in php that does not need any special packages installed and does not need shell access.

      Also do most webhosts allow shell access to unpack using a script

      something like

      <?php system('unzip zipFileName.zip'); ?>
      {{ DiscussionBoard.errors[5945584].message }}
      • Profile picture of the author phpg
        Originally Posted by misha7878 View Post

        Is there any script in php that does not need any special packages installed and does not need shell access.

        Also do most webhosts allow shell access to unpack using a script

        something like

        <?php system('unzip zipFileName.zip'); ?>
        The important thing is are you going to do updates per server (many sites on a single server) or per site. To update per server you'll need root access (therefore you'll have shell access), and probably won't be able to unpack with some php script called from web. If you update per site, php has zip extension which is now enabled on most hosts, and what you suggested (system call of unzip) is also possible on most hosts.
        {{ DiscussionBoard.errors[5945669].message }}
  • Profile picture of the author phpg
    If it's something like whm where you have root access, you can upload something like .tar.gz with proper directory structure and unpack it via ssh with a single command. So technically the server will unpack it but you won't need to install any additional scripts there.
    {{ DiscussionBoard.errors[5945165].message }}
    • Profile picture of the author IMBotz
      It should be a on a mutli-core processor over a single core. When only single cores existed multi-threading was nothing but time slicing done by the OS.

      Technically only one thread can run at a time per core.
      {{ DiscussionBoard.errors[5945541].message }}
  • Profile picture of the author Earnie Boyd
    You could use something like rsync to modify one site and have the rsync script push the change to the other servers. Even something like 1 master server serves to X servers that in turn serve another X servers you could balance the load easily.

    Another method would be to use something like github to manage the content and have each server pull the updates from the github server.
    Signature
    {{ DiscussionBoard.errors[5958413].message }}

Trending Topics