IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

BENCHMARK SERVEUR - Votre avis m'interesse


Sujet :

PHP & Base de données

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre très actif Avatar de myz-rix
    Homme Profil pro
    Responsable de service informatique
    Inscrit en
    Janvier 2008
    Messages
    143
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Ariège (Midi Pyrénées)

    Informations professionnelles :
    Activité : Responsable de service informatique

    Informations forums :
    Inscription : Janvier 2008
    Messages : 143
    Par défaut BENCHMARK SERVEUR - Votre avis m'interesse
    Bonjour,

    J'ai codé un petit benchmark pour serveur php/mysql ne trouvant rien qui me convienne sur internet.

    Cela test les accès mysql, quelques calculs, et les accès disque.

    Si vous pouviez l'essayer sur vos serveurs respectifs et me copier/coller vos résultats ça serait top

    Ma config serveur:
    ASUS P5QL-pro
    Intel Q8200
    2Go mémoire


    Ubuntu 9.10 en virtualbox sous windows 7

    MOTEUR MYSQL MEMORY
    MYSQL ecriture 77 97
    MYSQL recherche varchar 39 77
    MYSQL recherche int 32 234
    MOTEUR MYSQL MYISAM
    MYSQL ecriture 86 86
    MYSQL recherche varchar 39 77
    MYSQL recherche int 95 79
    CALCUL
    INCREMENTATION++ 25 108
    MATHEMATIQUE 50 96
    DISQUE
    DISQUE Ecriture 37 41
    DISQUE Lecture 64 94
    DISQUE Ecriture Gros fichier 110 55
    DISQUE Lecture Gros fichier 62 97
    TEMPS 716s
    SCORE 1140

    Et vous ça donne quoi ?

    A mettre dans un fichier index.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
     
     
    <?
    date_default_timezone_set("Europe/Paris");
    ini_set('max_execution_time', 0);
    $t_start = mktime();
     
     
    //********************************************************************
    //*** LAMP BENCH 2010 par myz-rix ************************************
    //********************************************************************
     
     
    //********************************************************************
    //********************************************************************
    //********************* CONFIGURATION MYSQL **************************
    //********************************************************************
    //********************************************************************
     
    $mysql_host ="localhost";
    $mysql_user ="root";
    $mysql_pass ="";
    $mysql_base = "bench";
     
    //********************************************************************
    //********************************************************************
    //********************************************************************
    //********************************************************************
    //********************************************************************
     
     
     
     
     
     
     
     
     
    $hard = 3; // niveau de difficulté
    $t_total = 0;
     
    $MYSQL_MOTEUR_ARRAY = array("MEMORY","MYISAM");
    mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die(mysql_error());
    mysql_query("SET global max_heap_table_size=128*1024*1024") or die(mysql_error());
    mysql_query("SET global tmp_table_size=128*1024*1024") or die(mysql_error());
     
    foreach($MYSQL_MOTEUR_ARRAY as $MYSQL_MOTEUR)
    {//96585
    //****************************************************************
    //*** ECRITURE *** 
    //****************************************************************
    $mysql_ecriture_i = 0;
    ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'} = mktime();
     
    mysql_query("DROP DATABASE `$mysql_base`");
    mysql_query("CREATE DATABASE `$mysql_base`") or die(mysql_error());
    mysql_query("CREATE TABLE `$mysql_base`.`table` (
    `i` INT( 10 ) UNSIGNED NOT NULL ,
    `v` VARCHAR( 255 ) NOT NULL ,
    `d` DOUBLE NOT NULL
    ) ENGINE = '".$MYSQL_MOTEUR."' ") or die(mysql_error());
     
    for($i = 1000000000; $i < (10000000000*$hard);$i = $i + 100000)
     {
     mysql_query("INSERT INTO `$mysql_base`.`table` (i,v,d) VALUES ('$i','".md5($i)."','".($i/100000)."')") or die(mysql_error());
     $mysql_ecriture_i++;
     }
     
    ${'t_mysql_ecriture_'.$MYSQL_MOTEUR} = mktime()- ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'};
    ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_us'} = ($mysql_ecriture_i / ${'t_mysql_ecriture_'.$MYSQL_MOTEUR})/39;
    $t_total = $t_total + ${'t_mysql_ecriture_'.$MYSQL_MOTEUR};
    $total_us = $total_us + ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_us'};
     
    //****************************************************************
    //*** RECHERCHE VARCHAR *** 
    //****************************************************************
    $recherche_i = $hard*50000;
    ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'} = mktime();
    for($i = 0; $i < ($recherche_i);$i++)
     {
     $recherche_1978_req = mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE v LIKE '%1978%' ORDER BY v,d,i DESC") or die(mysql_error());
     //$recherche_1978_data = mysql_fetch_array($recherche_1978_req);
     //print '<br>'.$champ.':'.mysql_num_rows($recherche_1978_req).' - '.$recherche_1978_data[v];
     }
    ${'t_mysql_recherche_'.$MYSQL_MOTEUR} = mktime()- ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'};
    ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_us'} = ($recherche_i / ${'t_mysql_recherche_'.$MYSQL_MOTEUR})/50;
    $t_total = $t_total + ${'t_mysql_recherche_'.$MYSQL_MOTEUR};
    $total_us = $total_us + ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_us'};
     
    //****************************************************************
    //*** RECHERCHE INT *** 
    //****************************************************************
    $recherche_int_i = $hard*10;
    ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'} = mktime();
    for($i = 0; $i < ($recherche_int_i);$i++)
     {
     mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE i > 1 ORDER BY i DESC") or die(mysql_error());
     //print '<br>'.$champ.':'.mysql_num_rows($recherche_1978_req);
     }
    ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR} = mktime()- ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'};
    ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_us'} = ($recherche_int_i / ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR})*250;
    $t_total = $t_total + ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR};
    $total_us = $total_us + ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_us'};
    }//96585
     
     
     
    //****************************************************************
    //*** INCREMENTATION *** 
    //****************************************************************
    $incrementation_i = 100000000*$hard;
    $t_incrementation_i = mktime();
    for($i = 0; $i < ($incrementation_i);$i++)
     {
     // on patiente
     }
    $t_incrementation = mktime() - $t_incrementation_i;
    $incrementation_us = ($incrementation_i / $t_incrementation)/111111;
    $t_total = $t_total + $t_incrementation;
    $total_us = $total_us + $incrementation_us;
     
    //****************************************************************
    //*** MATHEMATIQUE *** 
    //****************************************************************
    $t_mathematique_i = mktime();
    $mathematique_i = 10000000*$hard;
    for($i = 0; $i < ($mathematique_i);$i++)
     {
     // racine carré
     sqrt($i);
     // Sinus
     sin($i);
     // decimal binaire hexa
     decbin($i);
     dechex($i);
     }
    $t_mathematique = mktime() - $t_mathematique_i;
    $mathematique_us = ($mathematique_i / $t_mathematique)/6250;
    $t_total = $t_total + $t_mathematique; 
    $total_us = $total_us + $mathematique_us;
     
    //****************************************************************
    //*** ECRITURE DISQUE *** 
    //****************************************************************
    $t_disque_w_i = mktime();
    $disque_w_i = 100000*$hard;
    for($i = 0; $i < ($disque_w_i);$i++)
     {
     $fichier = fopen("./test.csv",'w+');
     fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     fclose($fichier);
     }
    $t_disque_w = mktime() - $t_disque_w_i;
    $disque_w_us = ($disque_w_i / $t_disque_w)/200;
    $t_total = $t_total + $t_disque_w;
    $total_us = $total_us + $disque_w_us;
     
    //****************************************************************
    //*** DISQUE LECTURE*** 
    //****************************************************************
    $t_disque_r_i = mktime();
    $disque_r_i = 100000*10*$hard;
    for($i = 0; $i < ($disque_r_i);$i++)
     {
     $fichier = fopen("./test.csv",'r');
     //fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     fclose($fichier);
     }
    $t_disque_r = mktime() - $t_disque_r_i;
    $disque_r_us = ($disque_r_i / $t_disque_r)/500;
    $t_total = $t_total + $t_disque_r;
    $total_us = $total_us + $disque_r_us;
     
     
    //****************************************************************
    //*** ECRITURE DISQUE  GROS FICHIER*** 
    //****************************************************************
    $boucle_i = 10;
    $t_disque_gw_i = mktime();
    $disque_gw_i = $boucle_i*$hard;
    for($x = 0; $x < ($disque_gw_i);$x++)
    {
    @unlink("./test_g.csv");
    $fichier = fopen("./test_g.csv",'w+');
    for($i = 0; $i < (300000);$i++)
     {
     fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     }
    fclose($fichier);
    }
    $t_disque_gw = mktime() - $t_disque_gw_i;
    $disque_gw_us = ($disque_gw_i/$t_disque_gw)*200;
    $t_total = $t_total + $t_disque_gw;
    $total_us = $total_us + $disque_gw_us;
     
    //****************************************************************
    //*** DISQUE LECTURE GROS FICHIER*** 
    //****************************************************************
    $t_disque_gr_i = mktime();
    $disque_gr_i = $boucle_i*100000*$hard;
    for($i = 0; $i < ($disque_gr_i);$i++)
     {
     $fichier = fopen("./test_g.csv",'r');
     //fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     fclose($fichier);
     }
    $t_disque_gr = mktime() - $t_disque_gr_i;
    $disque_gr_us = ($disque_gr_i / $t_disque_gr)/500;
    $t_total = $t_total + $t_disque_gr;
    $total_us = $total_us + $disque_gr_us;
     
     
     
    //*********************
    mysql_query("DROP DATABASE `$mysql_base`");
    unlink("./test_g.csv");
    unlink("./test.csv");
    //*********************
    $color = "00aa00";
    print '<center>';
    print '<table width=400 bgcolor="eeeeee">';
    foreach($MYSQL_MOTEUR_ARRAY as $MYSQL_MOTEUR)
    {
    print '<tr><td colspan=20 bgcolor="888888"><font color="ffffff"><center>MOTEUR MYSQL '.$MYSQL_MOTEUR.'</td></tr>';
    print '<tr><td>MYSQL ecriture</td><td align="right">'.${'t_mysql_ecriture_'.$MYSQL_MOTEUR}.'s</td><td align="right"><font color="'.$color.'">'.round(${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_us'},0).'</td></Tr>';
    print '<tr><td>MYSQL recherche varchar</td><td align="right">'.${'t_mysql_recherche_'.$MYSQL_MOTEUR}.'s</td><td align="right"><font color="'.$color.'">'.round(${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_us'},0).'</td></Tr>';
    print '<tr><td>MYSQL recherche int</td><td align="right">'.${'t_mysql_recherche_int_'.$MYSQL_MOTEUR}.'s</td><td align="right"><font color="'.$color.'">'.round(${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_us'},0).'</td></Tr>';
    }
     
    print '<tr><td colspan=20 bgcolor="888888"><font color="ffffff"><center>CALCUL</td></tr>';
    print '<tr><td>INCREMENTATION++</td><td align="right">'.$t_incrementation.'s</td><td align="right"><font color="'.$color.'">'.round($incrementation_us,0).'</td></Tr>';
    print '<tr><td>MATHEMATIQUE</td><td align="right">'.$t_mathematique.'s</td><td align="right"><font color="'.$color.'">'.round($mathematique_us,0).'</td></Tr>';
     
    print '<tr><td colspan=20 bgcolor="888888"><font color="ffffff"><center>DISQUE</td></tr>';
    print '<tr><td>DISQUE Ecriture</td><td align="right">'.$t_disque_w.'s</td><td align="right"><font color="'.$color.'">'.round($disque_w_us,0).'</td></Tr>';
    print '<tr><td>DISQUE Lecture</td><td align="right">'.$t_disque_r.'s</td><td align="right"><font color="'.$color.'">'.round($disque_r_us,0).'</td></Tr>';
    print '<tr><td>DISQUE Ecriture Gros fichier</td><td align="right">'.$t_disque_gw.'s</td><td align="right"><font color="'.$color.'">'.round($disque_gw_us,0).'</td></Tr>';
    print '<tr><td>DISQUE Lecture Gros fichier</td><td align="right">'.$t_disque_gr.'s</td><td align="right"><font color="'.$color.'">'.round($disque_gr_us,0).'</td></Tr>';
     
    print '<tr><td colspan=20 align="right"><center><b>TEMPS '.($t_total).'s</td></tr>';
    print '<tr><td colspan=20 align="right"><center><font color="'.$color.'" size=8><b>SCORE '.round($total_us,0).'</td></tr>';
    print '</table>';
     
    ?>

  2. #2
    Membre très actif Avatar de myz-rix
    Homme Profil pro
    Responsable de service informatique
    Inscrit en
    Janvier 2008
    Messages
    143
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Ariège (Midi Pyrénées)

    Informations professionnelles :
    Activité : Responsable de service informatique

    Informations forums :
    Inscription : Janvier 2008
    Messages : 143
    Par défaut Version 2 & Résultats
    Je vois que ça intéresse personne, alors je continue

    Testé sur un Processeur Q8200 sous windows vista j'obtiens 22500 secondes,
    je répette 22500 secondes !!!
    serveur lamp sous windows = à eviter à tout prix

    Q8200 avec Debian sqeeze 64 bits => 400 secondes
    I7 2600 + SSD C300 64Mo sur Debian sqeeze 32bits => 240 secondes
    I7 2600 + SSD C300 64Mo sur Debian sqeeze 64bits => 187 secondes

    On voit dessuite que Linux est 100 fois plus efficace que windows sur ce type de serveur.
    De plus le 64 bits est très très efficace.

    J'aimerai bien avoir vos test à vous s'il vous plait .

    Si jamais au premier lancement vous avez un message d'erreur, faite F5 pour relancer.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
     
    <?
    date_default_timezone_set("Europe/Paris");
    ini_set('max_execution_time', 0);
     
    $t_start = mktime();
     
     
    //********************************************************************
    //*** LAMP BENCH 2010 par myz-rix ************************************
    //********************************************************************
     
     
    //********************************************************************
    //********************************************************************
    //********************* CONFIGURATION MYSQL **************************
    //********************************************************************
    //********************************************************************
     
    $mysql_host ="localhost";
    $mysql_user ="root";
    $mysql_pass ="";
    $mysql_base = "bench";
     
    //********************************************************************
    //********************************************************************
    //********************************************************************
    //********************************************************************
    //********************************************************************
     
     
     
     
     
     
     
     
     
    $hard = 3; // niveau de difficulté
    $t_total = 0;
     
    $MYSQL_MOTEUR_ARRAY = array("MEMORY","MYISAM");
    mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die(mysql_error());
    mysql_query("SET global max_heap_table_size=128*1024*1024") or die(mysql_error());
    mysql_query("SET global tmp_table_size=128*1024*1024") or die(mysql_error());
     
    foreach($MYSQL_MOTEUR_ARRAY as $MYSQL_MOTEUR)
    {//96585
    //****************************************************************
    //*** ECRITURE *** 
    //****************************************************************
    $mysql_ecriture_i = 0;
    ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'} = mktime();
     
    mysql_query("DROP DATABASE `$mysql_base`");
    mysql_query("CREATE DATABASE `$mysql_base`") or die(mysql_error());
    mysql_query("CREATE TABLE `$mysql_base`.`table` (
    `i` INT( 10 ) UNSIGNED NOT NULL ,
    `v` VARCHAR( 255 ) NOT NULL ,
    `d` DOUBLE NOT NULL
    ) ENGINE = '".$MYSQL_MOTEUR."' ") or die(mysql_error());
     
    for($i = 1000000000; $i < (10000000000*$hard);$i = $i + 100000)
     {
     mysql_query("INSERT INTO `$mysql_base`.`table` (i,v,d) VALUES ('$i','".md5($i)."','".($i/100000)."')") or die(mysql_error());
     $mysql_ecriture_i++;
     }
     
    ${'t_mysql_ecriture_'.$MYSQL_MOTEUR} = mktime()- ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'};
    ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_us'} = ($mysql_ecriture_i / ${'t_mysql_ecriture_'.$MYSQL_MOTEUR})/39;
    $t_total = $t_total + ${'t_mysql_ecriture_'.$MYSQL_MOTEUR};
    $total_us = $total_us + ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_us'};
     
    //****************************************************************
    //*** RECHERCHE VARCHAR *** 
    //****************************************************************
    $recherche_i = $hard*50000;
    ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'} = mktime();
    for($i = 0; $i < ($recherche_i);$i++)
     {
     $recherche_1978_req = mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE v LIKE '%1978%' ORDER BY v,d,i DESC") or die(mysql_error());
     //$recherche_1978_data = mysql_fetch_array($recherche_1978_req);
     //print '<br>'.$champ.':'.mysql_num_rows($recherche_1978_req).' - '.$recherche_1978_data[v];
     }
    ${'t_mysql_recherche_'.$MYSQL_MOTEUR} = mktime()- ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'};
    ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_us'} = ($recherche_i / ${'t_mysql_recherche_'.$MYSQL_MOTEUR})/50;
    $t_total = $t_total + ${'t_mysql_recherche_'.$MYSQL_MOTEUR};
    $total_us = $total_us + ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_us'};
     
    //****************************************************************
    //*** RECHERCHE INT *** 
    //****************************************************************
    $recherche_int_i = $hard*10;
    ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'} = mktime();
    for($i = 0; $i < ($recherche_int_i);$i++)
     {
     mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE i > 1 ORDER BY i DESC") or die(mysql_error());
     //print '<br>'.$champ.':'.mysql_num_rows($recherche_1978_req);
     }
    ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR} = mktime()- ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'};
    ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_us'} = ($recherche_int_i / ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR})*250;
    $t_total = $t_total + ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR};
    $total_us = $total_us + ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_us'};
    }//96585
     
     
     
    //****************************************************************
    //*** INCREMENTATION *** 
    //****************************************************************
    $incrementation_i = 100000000*$hard;
    $t_incrementation_i = mktime();
    for($i = 0; $i < ($incrementation_i);$i++)
     {
     // on patiente
     }
    $t_incrementation = mktime() - $t_incrementation_i;
    $incrementation_us = ($incrementation_i / $t_incrementation)/111111;
    $t_total = $t_total + $t_incrementation;
    $total_us = $total_us + $incrementation_us;
     
    //****************************************************************
    //*** MATHEMATIQUE *** 
    //****************************************************************
    $t_mathematique_i = mktime();
    $mathematique_i = 10000000*$hard;
    for($i = 0; $i < ($mathematique_i);$i++)
     {
     // racine carré
     sqrt($i);
     // Sinus
     sin($i);
     // decimal binaire hexa
     decbin($i);
     dechex($i);
     }
    $t_mathematique = mktime() - $t_mathematique_i;
    $mathematique_us = ($mathematique_i / $t_mathematique)/6250;
    $t_total = $t_total + $t_mathematique; 
    $total_us = $total_us + $mathematique_us;
     
    //****************************************************************
    //*** ECRITURE DISQUE *** 
    //****************************************************************
    $t_disque_w_i = mktime();
    $disque_w_i = 100000*$hard;
    for($i = 0; $i < ($disque_w_i);$i++)
     {
     $fichier = fopen("./test.csv",'w+');
     fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     fclose($fichier);
     }
    $t_disque_w = mktime() - $t_disque_w_i;
    $disque_w_us = ($disque_w_i / $t_disque_w)/200;
    $t_total = $t_total + $t_disque_w;
    $total_us = $total_us + $disque_w_us;
     
    //****************************************************************
    //*** DISQUE LECTURE*** 
    //****************************************************************
    $t_disque_r_i = mktime();
    $disque_r_i = 100000*10*$hard;
    for($i = 0; $i < ($disque_r_i);$i++)
     {
     $fichier = fopen("./test.csv",'r');
     //fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     fclose($fichier);
     }
    $t_disque_r = mktime() - $t_disque_r_i;
    $disque_r_us = ($disque_r_i / $t_disque_r)/500;
    $t_total = $t_total + $t_disque_r;
    $total_us = $total_us + $disque_r_us;
     
     
    //****************************************************************
    //*** ECRITURE DISQUE  GROS FICHIER*** 
    //****************************************************************
    $boucle_i = 10;
    $t_disque_gw_i = mktime();
    $disque_gw_i = $boucle_i*$hard;
    for($x = 0; $x < ($disque_gw_i);$x++)
    {
    @unlink("./test_g.csv");
    $fichier = fopen("./test_g.csv",'w+');
    for($i = 0; $i < (300000);$i++)
     {
     fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     }
    fclose($fichier);
    }
    $t_disque_gw = mktime() - $t_disque_gw_i;
    $disque_gw_us = ($disque_gw_i/$t_disque_gw)*200;
    $t_total = $t_total + $t_disque_gw;
    $total_us = $total_us + $disque_gw_us;
     
    //****************************************************************
    //*** DISQUE LECTURE GROS FICHIER*** 
    //****************************************************************
    $t_disque_gr_i = mktime();
    $disque_gr_i = $boucle_i*100000*$hard;
    for($i = 0; $i < ($disque_gr_i);$i++)
     {
     $fichier = fopen("./test_g.csv",'r');
     //fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
     fclose($fichier);
     }
    $t_disque_gr = mktime() - $t_disque_gr_i;
    $disque_gr_us = ($disque_gr_i / $t_disque_gr)/500;
    $t_total = $t_total + $t_disque_gr;
    $total_us = $total_us + $disque_gr_us;
     
     
     
    //*********************
    mysql_query("DROP DATABASE `$mysql_base`");
    unlink("./test_g.csv");
    unlink("./test.csv");
    //*********************
    $color = "00aa00";
    print '<center>';
    print '<table width=400 bgcolor="eeeeee">';
    foreach($MYSQL_MOTEUR_ARRAY as $MYSQL_MOTEUR)
    {
    print '<tr><td colspan=20 bgcolor="888888"><font color="ffffff"><center>MOTEUR MYSQL '.$MYSQL_MOTEUR.'</td></tr>';
    print '<tr><td>MYSQL ecriture</td><td align="right">'.${'t_mysql_ecriture_'.$MYSQL_MOTEUR}.'s</td><td align="right"><font color="'.$color.'">'.round(${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_us'},0).'</td></Tr>';
    print '<tr><td>MYSQL recherche varchar</td><td align="right">'.${'t_mysql_recherche_'.$MYSQL_MOTEUR}.'s</td><td align="right"><font color="'.$color.'">'.round(${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_us'},0).'</td></Tr>';
    print '<tr><td>MYSQL recherche int</td><td align="right">'.${'t_mysql_recherche_int_'.$MYSQL_MOTEUR}.'s</td><td align="right"><font color="'.$color.'">'.round(${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_us'},0).'</td></Tr>';
    }
     
    print '<tr><td colspan=20 bgcolor="888888"><font color="ffffff"><center>CALCUL</td></tr>';
    print '<tr><td>INCREMENTATION++</td><td align="right">'.$t_incrementation.'s</td><td align="right"><font color="'.$color.'">'.round($incrementation_us,0).'</td></Tr>';
    print '<tr><td>MATHEMATIQUE</td><td align="right">'.$t_mathematique.'s</td><td align="right"><font color="'.$color.'">'.round($mathematique_us,0).'</td></Tr>';
     
    print '<tr><td colspan=20 bgcolor="888888"><font color="ffffff"><center>DISQUE</td></tr>';
    print '<tr><td>DISQUE Ecriture</td><td align="right">'.$t_disque_w.'s</td><td align="right"><font color="'.$color.'">'.round($disque_w_us,0).'</td></Tr>';
    print '<tr><td>DISQUE Lecture</td><td align="right">'.$t_disque_r.'s</td><td align="right"><font color="'.$color.'">'.round($disque_r_us,0).'</td></Tr>';
    print '<tr><td>DISQUE Ecriture Gros fichier</td><td align="right">'.$t_disque_gw.'s</td><td align="right"><font color="'.$color.'">'.round($disque_gw_us,0).'</td></Tr>';
    print '<tr><td>DISQUE Lecture Gros fichier</td><td align="right">'.$t_disque_gr.'s</td><td align="right"><font color="'.$color.'">'.round($disque_gr_us,0).'</td></Tr>';
     
    print '<tr><td colspan=20 align="right"><center><b>TEMPS '.($t_total).'s</td></tr>';
    print '<tr><td colspan=20 align="right"><center><font color="'.$color.'" size=8><b>SCORE '.round($total_us,0).'</td></tr>';
    print '</table>';
     
    ?>

  3. #3
    Responsable Qt & Livres


    Avatar de dourouc05
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2008
    Messages
    26 772
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Août 2008
    Messages : 26 772
    Par défaut


    Comment tires-tu tes conclusion ? À la va-vite. Et encore, je pense que c'est l'escargot face à ce que tu fais.

    Un serveur Windows est absolument à éviter ? Quelles versions de PHP as-tu testé ? Quelle bitness de l'OS (32/64 bits) ? Quelle bitness de PHP ? Comment as-tu lancé ton script (CLI, Web) ? Quel serveur Web (Apache, Nginx, IIS...) ? Quel compilateur pour PHP (VC6 / VC9) ? Que faisais-tu à côté de ces tests ?

    Et encore, je me limite au couple PHP/OS. Quid de MySQL ? Quid de l'activité disque dur ? Quels étaient les systèmes de fichiers utilisés ? Leurs vesrions ? Tu parles de gros fichier ; ça veut dire quoi, pour toi, gros fichier ? Le maximum d'un ancestral FAT32, soit 2 Go ? Un back-up complet d'un serveur réaliste, des dizaines de Go ?

    Tant de points qui me font dire que, sans étonnement, ceci ne vaut rien...
    Vous souhaitez participer aux rubriques Qt (tutoriels, FAQ, traductions) ou HPC ? Contactez-moi par MP.

    Créer des applications graphiques en Python avec PyQt5
    Créer des applications avec Qt 5.

    Pas de question d'ordre technique par MP !

  4. #4
    Membre très actif Avatar de myz-rix
    Homme Profil pro
    Responsable de service informatique
    Inscrit en
    Janvier 2008
    Messages
    143
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Ariège (Midi Pyrénées)

    Informations professionnelles :
    Activité : Responsable de service informatique

    Informations forums :
    Inscription : Janvier 2008
    Messages : 143
    Par défaut Oh mon Dieu.
    J'ai faché tout rouge Dourouc05 qui doit surement avoir des actions chez Microsoft pour se facher pour si peu.

    (Pas la pein d'agresser les gens)

    As tu fait le test sous ton windows avec le bitness que tu veux, avec le php que tu veux, avec ou sans la cafetiere d'allumer... ? Non ?

    Je viens ici car je viens chercher des personnes qui me permettent d'avancer, je suis pas un débutant en informatique et j'apprecierai qu'on me parle autrement !

    J'attend donc qu'une chose qu'on me prouve qu'un serveur web php windows va plus vite que son équivalent Linux, car ce sont MES conclusions après avoir MES test.

    Maintenant pour te répondre, j'ai essayé plusieurs config windows qui ont donné des résultats presque similaire donc supérieur à 20 000s soit 100 fois plus lente que sur mes différents test Linux.

    3 Machines de test différentes, (cpu: Q8200,Q8300,Xeon, disque:scsi,...)
    3 Os différents Vista 32, Xp 32 et Seven 32
    Php et Mysql version équivalente à celle sur Linux
    Serveur Pret à l'emploi: Easyphp et Lamp testé
    Script lancé par navigateur Firefox sur toutes les configs.
    Aucune autre activité sur le pc pendant le test (je suis pas débile!)
    NTFS pour windows, Ext4 pour Linux.

    Maintenant si des personnes agréable et sympathique peuvent essayer mon script pour me donner leur résultats, ça me permettrait d'avancer. merci

  5. #5
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    Je trouve le code un peu vieillot
    les <?
    les or die
    les @
    les fopen
    le HTML tout vieux

    y'a 10 ans le code aurait (peu être) eu son intérêt, mais la...

  6. #6
    Membre très actif Avatar de myz-rix
    Homme Profil pro
    Responsable de service informatique
    Inscrit en
    Janvier 2008
    Messages
    143
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Ariège (Midi Pyrénées)

    Informations professionnelles :
    Activité : Responsable de service informatique

    Informations forums :
    Inscription : Janvier 2008
    Messages : 143
    Par défaut
    J'avoue que mon code est peu vieillot, maintenant ça n'empeche pas de comparer une machine à une autre.

    J'ai bien dit ça ne change rien pour comparer une machine à une autre, j'en vois deja me dire:
    "mais si ! le code est important, si il est mieux fait ça va plus vite".....

    pouvez vous le tester s'il vous plait et me donner vos résultats ?

Discussions similaires

  1. Réponses: 16
    Dernier message: 14/09/2007, 12h52
  2. BTS IG - Lacunes en maths, votre avis m'interesse
    Par leodavinci94 dans le forum Etudes
    Réponses: 8
    Dernier message: 05/09/2007, 09h14
  3. Votre avis m'interesse !
    Par BrItneY dans le forum Flash
    Réponses: 24
    Dernier message: 28/06/2006, 15h42
  4. [Plugin][WTP] votre avis m'interesse.
    Par phalae dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 22/02/2006, 14h17
  5. [votre avis m'interesse] Interface avec un programme Java
    Par LineLe dans le forum Interfaces Graphiques en Java
    Réponses: 29
    Dernier message: 11/12/2004, 11h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo