PreviousNextUpFAQ Table of Contents

Red Hat Linux 5.1

JDK for Linux

You should run the latest Java virtual machine for Linux, available from the Blackdown Organization:

You should run JDK 1.1.6 Version 4a or later, since earlier versions had a bug in the socket timeout feature of Java. Not all of the mirror sites carry this latest version, so make sure to find a site with the file:

jdk1.1.6v4a-i386-glibc.tar.gz

You can verify your installation by typing "java -fullversion" from the command line. You should see a version with the following date or later:

java full version "stevemw:08/29/98-05:16"

File descriptors

Unless you rebuild the Linux kernel, each process is limited to 256 file descriptors. Since the VolanoChat server requires one file descriptor for each concurrent socket connection, you are limited by default to a maximum of 256 simultaneous connections.

The new Linux 2.1 kernel has support for 1024 file descriptors per process without requiring a rebuild, but Linux distributions ship the Linux 2.0 kernel. Red Hat Linux 4.2 uses the Linux 2.0.30 kernel, while Red Hat Linux 5.1 uses the Linux 2.0.34pre6 kernel. Oskar Pearson has posted a set of 2.0.34 kernel patches which can increase the file descriptor limits on your system. As an additional reference, the November 1997 issue of the Linux Journal magazine has a good article on rebuilding your kernel, titled Linux Kernel Installation.

You may be able to increase the file descriptor limit and rebuild the kernel yourself by making the following changes, given by David Schwartz. Keep in mind, though, that the instructions below may be different for your system.

  1. In /usr/include/linux/fs.h, change NR_OPEN from 256 to 1024.
  2. In /usr/include/linux/limits.h, change both NR_OPEN and OPEN_MAX from 256 to 1024.
  3. In /usr/include/linux/posix_types.h, make sure __FD_SETSIZE is set to 1024.
  4. In /usr/include/gnu/types.h, change __FD_SETSIZE from 256 to 1024.
  5. To increase the system wide file descriptor limit, add the following two lines to the /etc/rc.d/rc.local startup script:
    /bin/echo "4096" > /proc/sys/kernel/file-max
    /bin/echo "8192" > /proc/sys/kernel/inode-max
    
  6. Change to /usr/src/linux and set up the kernel sources with:
    make mrproper
    
  7. Configure your new kernel with:
    make xconfig
    
  8. Prepare for the build by entering:
    make dep
    make clean
    
  9. Then rebuild your kernel with the commands:
    make zImage
    make modules
    make modules_install
    
  10. Copy your new kernel to the root directory with:
    cp /usr/src/linux/arch/i386/boot/zImage /zImage
    
  11. Configure LILO by modifying /etc/lilo.conf and then running /sbin/lilo.
  12. Reboot and select your new kernel at the LILO boot prompt with:
    shutdown -r now
    

You can check whether your changes are effective by running the following C program:

#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>

void main(void) {
  int k = 3;
  while (dup(0) != -1)
    k++;
  printf("Opens = %d Fdsize = %d\n", k, sizeof(fd_set) * 8);
}

Both numbers printed should read 1024.


PreviousNextUpFAQ Check HTML Table of Contents