������ ����!

�� ����� �� �� ���������� � ��� ����� ���� ��������.

> ================
> To: [EMAIL PROTECTED]
> Subject: [OOPS] 1000+ clients on Linux.
> From: "Alexei A. Pogrebkov" <[EMAIL PROTECTED]>
> Date: Thu, 21 Jun 2001 14:47:30 +0400
> Reply-to: [EMAIL PROTECTED]
> Sender: [EMAIL PROTECTED]
>
> ������:
> http://www.mysql.com/doc/L/i/Linux.html �
> http://www.volano.com/linuxnotes.html
> ����� ��������� glibc � ���� 2.4.5 � kernel.org
> ������ glibc:
>
> http://download.sourceforge.net/pub/mirrors/mysql/Downloads/Linux/
> linuxthreads-2.2.2.patch
> �.�. ���������� ����������� ���������� ������ �� 4096 � ��������� ������
> ����� � �����.
> ������ NR_OPEN, OPEN_MAX, __FD_SETSIZE � ���� � � /usr/include/linux/....
> ��������, ���� � glibc.
> ����������� ����� /proc/sys/fs/files-max ��� � ������ � ������ rlimits �
> pam'e ��� ��� ��� ��� ���������������.
> (Opps'� ����������� �� root'a �� rlimits ���������, �������  ������ - ��
> ������ ������)
> ...
> --
> Konstantin N. Bezruchenko
> BK5536-RIPE
> ================

���������

uname -a
Linux hive 2.4.13 #7 Fri Oct 26 12:59:50 MSD 2001 i686 unknown

�����

NR_OPEN, OPEN_MAX, __FD_SETSIZE � ����

(/usr/src/linux-2.4.13/include/linux)

� � /usr/include/linux/.

� fs.h
...
 /* Fixed constants first: */
 #undef NR_OPEN
 #define NR_OPEN (4096*4096)     /* Absolute upper limit on fd num */
 #define INR_OPEN 4096           /* Initial setting for nfile rlimits */
 ...
 #define NR_FILE  8192   /* this can well be larger on a larger system */
 #define NR_RESERVED_FILES 10 /* reserved for root */
 #define NR_SUPER 256
 ...

 � limits.h

 #ifndef _LINUX_LIMITS_H
 #define _LINUX_LIMITS_H
 #define NR_OPEN         4096
 #define NGROUPS_MAX       32    /* supplemental group IDs are available */
 #define ARG_MAX       131072    /* # bytes of args + environ for exec() */
 #define CHILD_MAX        999    /* no limit :-) */
 #define OPEN_MAX        4096    /* # open files a process may have */
 #define LINK_MAX         127    /* # links a file may have */
 #define MAX_CANON        255    /* size of the canonical input queue */
 #define MAX_INPUT        255    /* size of the type-ahead buffer */
 #define NAME_MAX         255    /* # chars in a file name */
 #define PATH_MAX        4095    /* # chars in a path name */
 #define PIPE_BUF        4096    /* # bytes in atomic write to a pipe */
 #define RTSIG_MAX         32
 #endif

 � posix_types.h

 #undef __NFDBITS
 #define __NFDBITS       (8 * sizeof(unsigned long))
 #undef __FD_SETSIZE
 #define __FD_SETSIZE    4096
 #undef __FDSET_LONGS
 #define __FDSET_LONGS   (__FD_SETSIZE/__NFDBITS)
 #undef __FDELT
 #define __FDELT(d)      ((d) / __NFDBITS)
 #undef __FDMASK
 #define __FDMASK(d)     (1UL << ((d) % __NFDBITS))
 ...

 �����

 make clean
 make bzImage
 make modules
 make modules_install

 cp bzImage ...
 ������ lilo.conf
 lilo

 ulimit -n 4096
 ulimit -u 4096

 ������� ��� ������� ��������� ������� �� ����� 2000 �������� ������,
 � ��� ulimit -n 4096 - �� ����� 1000 ������.

 ---------
 #include <stdio.h>

 main ()
 {
         FILE *fp;
         int i;
         char name[100];

         mkdir("testdir");

         for(i = 0; i < 2000; i++) {
                 sprintf(name, "testdir/%d", i);
                 if ( (fp = fopen(name, "wb")) == NULL)
                         break;
         }
         printf("%d", i);
 }
 --------

���������� libpthreads.so ��������� �������.
�������� ������ ��������� 4096 ������.

 --------
 #include <stdio.h>
 #include <unistd.h>
 #include <pthread.h>

 #define MAX_THREADS 10000
 int i;

 void run(void) {
   char c;
   if (i < 10)
     printf("Address of c = %u KB\n", (unsigned int) &c / 1024);
   sleep(60 * 60);
 }

 int main(int argc, char *argv[]) {
   int rc = 0;
   pthread_t thread[MAX_THREADS];
   printf("Creating threads ...\n");
   for (i = 0; i < MAX_THREADS && rc == 0; i++) {
     rc = pthread_create(&(thread[i]), NULL, (void *) &run, NULL);
     if (rc == 0) {
       pthread_detach(thread[i]);
       printf("Creating threads ... %d \n", i);
       if ((i + 1) % 1000 == 0)
         printf("%i threads so far ...\n", i + 1);
     }
     else
       printf("Failed with return code %i creating thread %i.\n",
               rc, i + 1);
   }
   exit(0);
 }
 ---------

oops -c /etc/oops/oops.cfg -d -W 4000

�� ������ ��������� ������ 980 ������.

��� ���������� �������� "oopsctl stat" ������� "connection refuced".

���������� ��� ������ Web Polygraph.

����� ������ �������� oopsctl stat ����� ��������.

����� ���� ���

Linux hive 2.4.13 #7 Fri Oct 26 12:59:50 MSD 2001 i686 unknown

���������� ������ ���� �� ������� ������������� ����� �������� ������ ���
������ ��������? ��� oops ��� �������� ������ ���� �����, �� ����������?

_________________________
Ruslan Kazansky,
Kursk, Russia



=====================================================================
If you would like to unsubscribe from this list send message to
[EMAIL PROTECTED] with "unsubscribe oops" in message body.
Archive is accessible on http://lists.paco.net/oops-rus/


Дати відповідь електронним листом