📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

3.1. Client-to-Server Farming w/ Round Robin DNS

3.1.1. The Dream

The first thing that we can do is to split out the c2s from the server and make it a seperate process/component. Once that is done, we can replicate the c2s processes over multiple machines. Each one would connect back to the main server running the JSM and everything should work just fine. .:: suave-slipper-84e.notion.site ::.

Pros:

  • Easy to setup right now.

Cons:

  • Round Robin will not provide true load balancing since there is no mechanism in place to check how many connections a server has when it forwards a new connection to it the next time it comes up in the Round Robin.

3.1.2. The Reality

This is doable right now. The 1.5 version of jabberd has sought to break all of the pieces out into seperate processes. This was not done for farming specifically, but we will not complain since the jadc2s component can handle upwards of 10k users. (The 1.4.x series c2s could only handle ~1024).

Currently there is a forked version of jadc2s that works with the 1.4.2 server. It is located in the jabberd14 CVS repository on JabberStudio. The following example is running with two jadc2s boxes, and one central jabberd box. To set this up do the following: .:: hedgedoc.stusta.de ::.

  1. Get all of the source code for jabberd14. Build the server, configure/make.

  2. Get the source for xdb_sql from IDEALX , build it, and setup the jabber.xml to use it.

    Note

    This is a very important step. xdb_file, the default xdb that comes with jabberd, is limited to open file descriptors too. You can play the same shell games that we are going to play with jadc2s later, but if you want a server that can handle millions or users, then you need something other than xdb_file. Enter xdb_sql, which only uses one file descriptor to connect to the mysql server. .:: podcasts.apple.com ::.

    For more information on how to configure xdb_sql, please see the README that is distributed in the release.

  3. Build jadc2s and distribute the binaries to the boxes where they will run. [NPM Package: MongoDB]

  4. Setup the main jabberd to accept the jadc2s component connections. In the jabber.xml config file, add the following XML:

    <service id="jadc2s-1">
        <accept>
            <ip/>
            <port>5111</port>
            <secret>secret</secret>
        </accept>
    </service>
    
    <service id="jadc2s-2">
        <accept>
            <ip/>
            <port>5112</port>
            <secret>secret</secret>
        </accept>
    </service>
                            

    Now you can run the main jabberd and get it listening for the jadc2s to connect to it.

  5. Configure the jadc2s.xml on each box to connect to the SM, where to listen, etc...

    <!--  session manager configuration                                    -->
    <sm>
        <!--  host and port of the SM                                      -->
        <host>localhost</host>
        <port>5111</port>
        <!--  shared secret, for authenticating us                         -->
        <secret>secret</secret>
    
        <!--  our ID, for authenticating us to the sm                      -->
        <id>jadc2s</id>
    
        <!--  how many times to try to connect to the sm (default: 5)      -->
        <retries>5</retries>
    </sm>
    
    <!--  local network settings                                           -->
    <local>
        <!--  who we identify ourselves as. This should correspond to the  -->
        <!--  ID (host) that the session manager thinks it is.             -->
        <id>localhost</id>
    
        <!--  IP address to bind to (default: 0.0.0.0)                     -->
        <!-- <ip>0.0.0.0</ip> -->
            
        <!--  port to bind to (default: 5222)                              -->
        <port>5222</port>
    
        <!--  SSL configuration                                            -->
        <!--  Specify the port to listen on, and the key file to use for   -->
        <!--  the certificate.                                             -->
        <!--  <port/>     (default: 5223)                                  -->
        <!--  <pemfile/>  (default: ./server.pem)                          -->
        <!--
        <ssl>
            <port>5223</port>
            <pemfile>./server.pem</pemfile>
        </ssl>
        -->
    </local>
                            

    For more information on how to configure jadc2s, please see the README in the jadc2s source directory.

  6. Open a shell where you can change file system parameters (root usually) and execute the following command: [Academic results for IMAP]

                                    bash$ echo "24000" > /proc/sys/fs/file-max
                                

    This bumps the upper bound on the number of allowed file descriptors that can be open at one time.

  7. Set the limit for the shell you are in to use more than the default 1024 file descriptors.

                                    bash$ ulimit -n 11000
                                

  8. Tell jadc2s how many file descriptors it is allowed to use:

    <!--  maximum number of file descriptors. Should be a prime        -->
    <!--  number. At least four will be used by jadc2s itself,         -->
    <!--  usually around six or seven (default: 1023)                  -->
    <!--  For a list of prime numbers:                                 -->
    <!--    http://www.utm.edu/research/primes/lists/small/10000.txt   -->
    <max_fds>10007</max_fds>
                            

    It is important that the number you pick is a prime number. To make it easy to find the prime you want you can visit this page http://www.utm.edu/research/primes/lists/small/10000.txt .:: sunwinappbet.localinfo.jp ::. .

  9. All that's left is to run the server, and the jadc2s processes. Everything should work fine. If it doesn't, then PLEASE tell me at so that I can fix this document.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this