Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1511 connectés 

 


Dernière réponse
Sujet : Installer Linuxtreads [problème de glibc]
Limit comment je fais pour faire:
 

Citation :

diminuez STACK_SIZE  dans linuxthreads/internals.h  à 256 KB


 
alors que:

cat internals.h | grep STACK
#if !defined NOT_IN_libc && defined FLOATING_STACKS
#ifdef FLOATING_STACKS
#ifndef INITIAL_STACK_SIZE
#define INITIAL_STACK_SIZE  (4 * PAGE_SIZE)
#ifndef THREAD_MANAGER_STACK_SIZE
#define THREAD_MANAGER_STACK_SIZE  (2 * PAGE_SIZE - 32)
#ifndef THREAD_STACK_START_ADDRESS
#define THREAD_STACK_START_ADDRESS  __pthread_initial_thread_bos
#if !defined NOT_IN_libc && !defined FLOATING_STACKS

?


Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
Limit comment je fais pour faire:
 

Citation :

diminuez STACK_SIZE  dans linuxthreads/internals.h  à 256 KB


 
alors que:

cat internals.h | grep STACK
#if !defined NOT_IN_libc && defined FLOATING_STACKS
#ifdef FLOATING_STACKS
#ifndef INITIAL_STACK_SIZE
#define INITIAL_STACK_SIZE  (4 * PAGE_SIZE)
#ifndef THREAD_MANAGER_STACK_SIZE
#define THREAD_MANAGER_STACK_SIZE  (2 * PAGE_SIZE - 32)
#ifndef THREAD_STACK_START_ADDRESS
#define THREAD_STACK_START_ADDRESS  __pthread_initial_thread_bos
#if !defined NOT_IN_libc && !defined FLOATING_STACKS

?

Limit :'(
Limit :bounce:
Limit up
Limit remonte
Limit Je te remercie pour tes précisions :jap:  
 
 

Citation :

3 "Je n'ai que /usr/include/bits/local_lim.h. L'autre n'existe pas"
A ton avis pourquoi s'appelle t'il internal.h ?
Bien sur que tu ne l'a pas et d'ailleurs il serait completement inutile (et meme plutot dangereux) de modifier ces constantes dans la version installée et compilée.


J'ai bien compris ca ;) Mais en fait, ce fichier est bien celui qui est utilisé par ma glibc actuelle mais j'ai besoin de modifier un fichier dans les sources avant de compiler.
Ce fichier est censé être dans les sources avant de compiler donc que je puisse le modifier? :??:
 
 

Citation :

4 "Par ex, ca veut dire quoi ca? et relier MySQL avec le nouveau libpthread.a ?"  
Cela veut dire utiliser le fichier libpthread.a (et les headers) compilé avec les constantes modifiées lors de la compilation de MySQL.
 
La solution la moins risquée est de recompiler la glibc modifiée et MySQL dans une arborescence a part, ex en passant --prefix=/opt/mysql-ha/ (ha pour high availability) au configure:
pour glibc:
../glibc-2.3.2/configure --prefix=/opt/mysql-ha --enable-add-ons ....
et pour mysql:
LD_LIBRARY_PATH=/opt/mysql-ha/lib INCLUDE=/opt/mysql-ha/include LIB=/opt/mysql-ha/lib ../mysql-version/configure --prefix=/opt/mysql-ha ...
ps: pour le LIB c'est a verifer, en fonction de la version de autoconf ca peut etre LIBRARIE ou autre.


Ok pour la glibc je vois le truc par contre pour mysql, je ne vois pas comment utiliser LD_LIBRARY_PATH=/opt/mysql-ha/lib INCLUDE=/opt/mysql-ha/include LIB=/opt/mysql-ha/lib je dois taper ca tel quel?
 

10 si tu a vraiment besoin d'une telle montée en charge utilise PostgreSQL.

Effectivement le problème est lié avec la gestion des threads, mais c'est lié à la glibc et non à mysql

MaxMaverick 1 non on n'efface pas la glibc avant d'en remettre une autre, sinon plus de distro qui marche.
2 on ne remplace pas non plus comme ca la glibc,  
Tout le monde dit attention sous linux le plus dur c'est de recompiler son kernel, on voit bien que peu d'entre eux se sont amusés a mettre a jours une glibc a partir des sources.
3 "Je n'ai que /usr/include/bits/local_lim.h. L'autre n'existe pas"
A ton avis pourquoi s'appelle t'il internal.h ?
Bien sur que tu ne l'a pas et d'ailleurs il serait completement inutile (et meme plutot dangereux) de modifier ces constantes dans la version installée et compilée.
 
4 "Par ex, ca veut dire quoi ca? et relier MySQL avec le nouveau libpthread.a ?"  
Cela veut dire utiliser le fichier libpthread.a (et les headers) compilé avec les constantes modifiées lors de la compilation de MySQL.
 
La solution la moins risquée est de recompiler la glibc modifiée et MySQL dans une arborescence a part, ex en passant --prefix=/opt/mysql-ha/ (ha pour high availability) au configure:
pour glibc:
../glibc-2.3.2/configure --prefix=/opt/mysql-ha --enable-add-ons ....
et pour mysql:
LD_LIBRARY_PATH=/opt/mysql-ha/lib INCLUDE=/opt/mysql-ha/include LIB=/opt/mysql-ha/lib ../mysql-version/configure --prefix=/opt/mysql-ha ...
ps: pour le LIB c'est a verifer, en fonction de la version de autoconf ca peut etre LIBRARIE ou autre.
 
Et de lancer mysql via un script comme cela:


DEST=/opt/mysql-ha
LD_LIBRARY_PATH=${DEST}/lib
${DEST}/bin/mysql bla bla


 
5 pour ton pb de compilation de glibc, soit tu n'a pas les kernel-headers correspond a ton kernel en cours (et au passage les headers (fichiers de compilations) c'est pas les modules (fichiers binaires contenant du code deja compilé)).
Soit c'est headers ont ete mal installés.
Donc tu choppe le paquetage kernel-header si ton noyau est tjrs celui de la distro, sinon tu crée des liens comme suit:


cd /usr/include
ln -s /usr/src/linux-version/include/linux
ln -s /usr/src/linux-version/include/asm-i386 asm


Attention il faut que le kernel ai ete configuré avec make {menu|old|x|g|q}config
Ps: je viens de voire que tu as un paquet glibc-kernheaders,
tu devrai lister les fichiers qu'il contient et verifier qu'ils sont toujours presents, a priori il y a un pb.
 
6 A mon avis tu ferai bien de vérifer la validité de la methode que tu veut mettre en oeuvre parce que de toute evidence elles ne s'appliquent pas telles quelles a une glibc 2.3.2.
 
7 Je le redit mais bon, modifier les fichiers de /usr/include ne t'apporterais que des ennuis.
 
8 Avant de venir sur les forums ils y a des dizaines de sources d'informations que tu aurais du inspecter, notamment les guides de compilations de la glibc, les guides d'administration système de linux et autre howto disponibles sur tldp.org qui contiennent toutes c'est informations.
 
9 grep est capable de lire directement les fichiers sans passer par l'entrée standard.
et meme mieux, 'rgrep -l PTHREAD_THREADS_MAX *' dans la racine des sources de la glibc te retournera tout les noms de fichiers contenant une reference a la chaine recherchée.
 
10 si tu a vraiment besoin d'une telle montée en charge utilise PostgreSQL.

Limit remonte petit topic
Limit Je viens d'essayer avec --with-headers=/lib/modules/2.4.26-grsec et tjs la meme erreur au configure :/
 
Où sont ces fichiers? :D
 
merci
Limit Hello,  
 
Je viens d'essayer d'installer glibc-2.3.2
 
au configure j'ai cette erreur:

checking installed Linux kernel header files... TOO OLD!
configure: error: GNU libc requires kernel header files from
Linux 2.0.10 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 2.0.10 or later.  This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files.  To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.

j'utilise le kernel 2.4.26
 
 
De plus, une autre question:
 

Augmentez PTHREAD_THREADS_MAX  dans sysdeps/unix/sysv/linux/bits/local_lim.h  à 4096


# cat sysdeps/unix/sysv/linux/bits/local_lim.h | grep PTHREAD_THREADS_MAX
#


Là c'est en regardant dans le fichier de l'archive de la nouvelle glibc que je veux installer. Mais j'ai également ce fichier dans ma glibc actuel et cette fois-ci:

cat /usr/include/bits/local_lim.h | grep PTHREAD_THREADS_MAX
#define PTHREAD_THREADS_MAX     16384


 
 
 
est ce que je peux remplacer les deux fichiers?
en sachant que les voici:

cat /usr/include/bits/local_lim.h
/* Minimum guaranteed maximum values for system limits.  Linux version.
   Copyright (C) 1993-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
 
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
 
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
 
   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */
 
/* The kernel header pollutes the namespace with the NR_OPEN symbol
   and defines LINK_MAX although filesystems have different maxima.  A
   similar thing is true for OPEN_MAX: the limit can be changed at
   runtime and therefore the macro must not be defined.  Remove this
   after including the header if necessary.  */
#ifndef NR_OPEN
# define __undef_NR_OPEN
#endif
#ifndef LINK_MAX
# define __undef_LINK_MAX
#endif
#ifndef OPEN_MAX
# define __undef_OPEN_MAX
#endif
 
/* The kernel sources contain a file with all the needed information.  */
#include <linux/limits.h>
 
/* Have to remove NR_OPEN?  */
#ifdef __undef_NR_OPEN
# undef NR_OPEN
# undef __undef_NR_OPEN
#endif
/* Have to remove LINK_MAX?  */
#ifdef __undef_LINK_MAX
# undef LINK_MAX
# undef __undef_LINK_MAX
#endif
/* Have to remove OPEN_MAX?  */
#ifdef __undef_OPEN_MAX
# undef OPEN_MAX
# undef __undef_OPEN_MAX
#endif
 
/* The number of data keys per process.  */
#define _POSIX_THREAD_KEYS_MAX  128
/* This is the value this implementation supports.  */
#define PTHREAD_KEYS_MAX        1024
 
/* Controlling the iterations of destructors for thread-specific data.  */
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS     4
/* Number of iterations this implementation does.  */
#define PTHREAD_DESTRUCTOR_ITERATIONS   _POSIX_THREAD_DESTRUCTOR_ITERATIONS
 
/* The number of threads per process.  */
#define _POSIX_THREAD_THREADS_MAX       64
/* This is the value this implementation supports.  */
#define PTHREAD_THREADS_MAX     16384
 
/* Maximum amount by which a process can descrease its asynchronous I/O
   priority level.  */
#define AIO_PRIO_DELTA_MAX      20
 
/* Minimum size for a thread.  We are free to choose a reasonable value.  */
#define PTHREAD_STACK_MIN       16384
 
/* Maximum number of POSIX timers available.  */
#define TIMER_MAX       256
 
/* Maximum number of timer expiration overruns.  */
#define DELAYTIMER_MAX  2147483647
 
/* Maximum tty name length.  */
#define TTY_NAME_MAX            32
 
/* Maximum login name length.  This is arbitrary.  */
#define LOGIN_NAME_MAX          256


 
et l'autre:

# cat sysdeps/unix/sysv/linux/bits/local_lim.h
/* Minimum guaranteed maximum values for system limits.  Linux version.
   Copyright (C) 1993-1998, 2000, 2003 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
 
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
 
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
 
   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */
 
/* The kernel header pollutes the namespace with the NR_OPEN symbol
   and defines LINK_MAX although filesystems have different maxima.  A
   similar thing is true for OPEN_MAX: the limit can be changed at
   runtime and therefore the macro must not be defined.  Remove this
   after including the header if necessary.  */
#ifndef NR_OPEN
# define __undef_NR_OPEN
#endif
#ifndef LINK_MAX
# define __undef_LINK_MAX
#endif
#ifndef OPEN_MAX
# define __undef_OPEN_MAX
#endif
 
/* The kernel sources contain a file with all the needed information.  */
#include <linux/limits.h>
 
/* Have to remove NR_OPEN?  */
#ifdef __undef_NR_OPEN
# undef NR_OPEN
# undef __undef_NR_OPEN
#endif
/* Have to remove LINK_MAX?  */
#ifdef __undef_LINK_MAX
# undef LINK_MAX
# undef __undef_LINK_MAX
#endif
/* Have to remove OPEN_MAX?  */
#ifdef __undef_OPEN_MAX
# undef OPEN_MAX
# undef __undef_OPEN_MAX
#endif
 
/* Maximum amount by which a process can descrease its asynchronous I/O
   priority level.  */
#define AIO_PRIO_DELTA_MAX      20
 
/* Maximum tty name length.  */
#define TTY_NAME_MAX            32
 
/* Maximum login name length.  This is arbitrary.  */
#define LOGIN_NAME_MAX          256


 
merci  :jap:

burgergold

Jar Jar a écrit :

Au passage si tu as un noyau 2.6 attention, la glibc n'utilisera pas LinuxThreads mais l'implémentation NPTL.


 
 :??:  
 
j'ai installé glibc avec linuxthread et la jsuis sur un 2.6.6

Limit non le dernier 2.4
Jar Jar Au passage si tu as un noyau 2.6 attention, la glibc n'utilisera pas LinuxThreads mais l'implémentation NPTL.
Limit remonte petit topic
Limit D'accord merci.
 
Avant de procéder à l'installation depuis les sources, je supprime les packages glibc  

glibc-kernheaders-2.4-7.16
glibc-2.3.2-4.80.8
glibc-common-2.3.2-4.80.8
glibc-devel-2.3.2-4.80.8
glibc-profile-2.3.2-4.80.8
glibc-debug-2.3.2-4.80.8


installés par rpm?
 
Ou sinon, je peux faire cohabiter 2 glibc et linker mysql avec la nouvelle mais je sais pas si c'est possible facilement :D

burgergold ftp://sources.redhat.com/pub/glibc/releases/
 
t'a 2 archives à prendre
 
glibc-2.3.2.tar.bz2
glibc-linuxthreads-2.3.2.tar.bz2
 
tu décompresse la 1er, ca te donne un dossier glibc-2.3.2
tu décompresse la 2e dans le dossier glibc-2.3.2, ca devrait te donner 2 dossier commencant par linuxthread
 
edit:
 
pour l'installation, suivre la partie Glibc dans le chapitre 6 à cet url
 
http://lfs.oregonstate.edu/lfs/view/5.0/
Limit autre question:
 
dans l'archive glibc-2.3.2 je n'ai pas de répertoire linuxthreads. :??:
 

/glibc-2.3.2# ls
BUGS          ChangeLog.7  NEWS          config-name.in        glibcbug.in  login          rpm             sysvipc
CONFORMANCE   ChangeLog.8  NOTES         config.h.in           gmon         mach           rt              termios
COPYING       ChangeLog.9  PROJECTS      config.make.in        gnulib       malloc         scripts         test-skeleton.c
COPYING.LIB   FAQ          README        configure             grp          manual         setjmp          time
ChangeLog     FAQ.in       README.libm   configure.in          hesiod       math           shadow          timezone
ChangeLog.1   INSTALL      Rules         conform               hurd         misc           shlib-versions  tls.make.c
ChangeLog.10  INTERFACE    Versions.def  cppflags-iterator.mk  iconv        nis            signal          version.h
ChangeLog.11  LICENSES     abi-tags      crypt                 iconvdata    nscd           socket          wcsmbs
ChangeLog.12  Make-dist    aclocal.m4    csu                   include      nss            soft-fp         wctype
ChangeLog.13  MakeTAGS     aout          ctype                 inet         o-iterator.mk  stdio-common
ChangeLog.2   Makeconfig   argp          debug                 intl         po             stdlib
ChangeLog.3   Makefile     assert        dirent                io           posix          streams
ChangeLog.4   Makefile.in  bare          dlfcn                 libio        pwd            string
ChangeLog.5   Makerules    catgets       elf                   locale       resolv         sunrpc
ChangeLog.6   NAMESPACE    conf          extra-lib.mk          localedata   resource       sysdeps


 
Par contre, sur le site cité précédemment j'ai récupéré une archive linuxthread. Il faut que je l'ajoute dans le rép de glic? Ca se compile séparement ou simultanément?

Limit Salut,  
 
J'ai besoin de faire ca:

Si vous planifiez d'avoir plus de 1000 connexions simultanées, vous aurez besoin d'apporter quelques modifications à LinuxThreads, le recompiler, et relier MySQL avec le nouveau libpthread.a  . Augmentez PTHREAD_THREADS_MAX  dans sysdeps/unix/sysv/linux/bits/local_lim.h  à 4096 et diminuez STACK_SIZE  dans linuxthreads/internals.h  à 256 KB. Les chemins sont relatifs à la racine de glibc  . Notez que MySQL ne sera pas stable autour de 600-1000 connexions si STACK_SIZE  est à 2 MB (par défaut).


 
J'utilise la glibc installé par rpm:

rpm -qa | grep glibc
glibc-kernheaders-2.4-7.16
glibc-2.3.2-4.80.8
glibc-common-2.3.2-4.80.8
glibc-devel-2.3.2-4.80.8
glibc-profile-2.3.2-4.80.8
glibc-debug-2.3.2-4.80.8


 
Et donc comme indiqué dans le paragraphe au dessus je cherche le fichier
 local_lim.h et internals.h. et Je n'ai que /usr/include/bits/local_lim.h. L'autre n'existe pas :??:
 
Sur ce site: http://pauillac.inria.fr/~xleroy/linuxthreads/ j'ai trouvé une archive avec les deux fichiers cités précédemment. Donc il faudrait que je modifie les sources et ensuite installe ce linuxthread ( pas de prob à priori ) mais ensuite, faut t'il modifier qqchose à la glibc?
 
Modifier qqchose dans mysql? dans son configure?
Par ex, ca veut dire quoi ca? et relier MySQL avec le nouveau libpthread.a ?
 
 Je n'ai rien trouvé de bien détaillé dans les docs :/
 
merci à vous


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR