Précédent   Forum des professionnels en informatique > PHP > PHP & SGBD > PHP & MySQL
PHP & MySQL Forum d'entraide sur les fonctions MySQL avec PHP. Avant de poster -> FAQ MySQL, Cours MySQL et Sources MySQL. Pour les questions concernant le moteur MySQL plutôt que les fonctions PHP, merci d'utiliser le forum MySQL.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 23/01/2011, 21h07   #1
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
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 :
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>';
 
?>
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 02
Vieux 03/03/2011, 20h41   #2
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
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 :
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>';
 
?>
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 02
Vieux 03/03/2011, 21h45   #3
Responsable Qt & Web sémantique

 
Avatar de dourouc05
 
Homme Thibaut Cuvelier
Étudiant
Inscription : août 2008
Messages : 16 281
Détails du profil
Informations personnelles :
Nom : Homme Thibaut Cuvelier
Localisation : Belgique

Informations professionnelles :
Activité : Étudiant
Secteur : Enseignement

Informations forums :
Inscription : août 2008
Messages : 16 281
Points : 49 821
Points : 49 821
Envoyer un message via MSN à dourouc05 Envoyer un message via Yahoo à dourouc05


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...
__________________
Le troisième défi Qt !

Vous souhaitez participer aux rubriques Qt ou PyQt/PySide (tutoriels, FAQ, traductions, sources) ? Contactez-moi par MP.

Qt : La FAQ : 200 QR
symfony : sfDoctrineGuard

Pas de question d'ordre technique par MP !
dourouc05 est déconnecté   Envoyer un message privé Réponse avec citation 21
Vieux 07/03/2011, 07h10   #4
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
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
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 02
Vieux 07/03/2011, 10h32   #5
Modérateur
 
Inscription : septembre 2010
Messages : 7 101
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 101
Points : 8 466
Points : 8 466
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...
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 02
Vieux 07/03/2011, 13h09   #6
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
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 ?
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 01
Vieux 07/03/2011, 13h27   #7
Modérateur
 
Inscription : septembre 2010
Messages : 7 101
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 101
Points : 8 466
Points : 8 466
marche pas, j'ai de belles erreurs :

Code :
1
2
3
4
Strict Standards: mktime(): You should be using the time() function instead in C:\www\test\index.php on line 6
 
Strict Standards: mktime(): You should be using the time() function instead in C:\www\test\index.php on line 53
Out of range value for column 'i' at row 1
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 07/03/2011, 13h50   #8
Membre émérite
 
Avatar de vorace
 
Homme
Développeur
Inscription : août 2010
Messages : 586
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : Développeur

Informations forums :
Inscription : août 2010
Messages : 586
Points : 859
Points : 859
tu pourrais mettre time() a la place de mktime()...
test en cours...je ne crois pas que ce sera fini avant que je ne rentre à la maison au quel j'aurai pas de résultat...
P.S. j'ai lancé le test, je poste sur le forum en même temps et en plus de la cafetière, j'ai le grille pain de branché...c'est grave ?

tout compte fait : test inutile...
j'ai même pas la patience d'attendre qu'il se termine...
attendre une plombe devant un script sans savoir ou il en est c'est trop frustrant pour moi...c'est pas faute d'avoir essayé !
__________________
Développeur informatique contrarié...
vorace est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 08/03/2011, 07h07   #9
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
Vorace:
Je vais essayer de rajouter une barre de progression,il est vrai que 400s sous linux c'est moins de 10 minutes, ça reste raisonnable mais dans mon cas sous windows 22 000 ça reste interminable et on sait jamais ou le script en est.

Donc correction time() + progresse barre

Quelle config as tu Vorace ?

stealth35:
Bizarre l'erreur, meme apres un F5 ?
Le F5 relance le script et fait que le depassement de mémoire pour la table mysql memory marche (j'ai pas trouvé mieux que de recharger avec F5)

Quelle confi as tu ?



Vous pourriez m'aider pour améliorer le script ?

car chez moi il tourne bien et sur toutes mes confis pas d'erreur mise à part de faire F5.
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/03/2011, 09h48   #10
Modérateur
 
Inscription : septembre 2010
Messages : 7 101
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 101
Points : 8 466
Points : 8 466
c'est pas bon parce que la valeur dépasse 4294967295 il faudrait donc la mettre en BIGINT, je te conseil aussi de mettre des indexes, le but d'un benchmark c'est pas non plus de faire souffrir le serveur,
comme le dis vorace c'est y'a pas trop de visibilité, je te conseil de mettre des petit echo avant chaque étape "Etape 1", et d'activer l'envoi implicite

sinon je comprend pas pourquoi la recherche varchar se fait 150 000 alors que la INT 30 fois ????

le lecture GROS FICHIERS est inutile puisque avec fopen que le fichier fasse 1Ko ou 1To pour lui c'est du stream donc c'est pareil seul la fragmentation pourrait réduire le temps d'accès mais c'est pas PHP le fautif.
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 08/03/2011, 20h19   #11
Membre émérite
 
Avatar de vorace
 
Homme
Développeur
Inscription : août 2010
Messages : 586
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : Développeur

Informations forums :
Inscription : août 2010
Messages : 586
Points : 859
Points : 859
ma config :
asus n61jv
processeur intel core i5
mémoire 4Go ddr3
mais il aime pas ton script...
y a pas que le tiens tu me diras...
__________________
Développeur informatique contrarié...
vorace est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 09/03/2011, 16h26   #12
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
J'ai tenu compte de vos remarque, j'ai donc ajouter:
une barre de progression globale
une barre de progression par test
Enlevé des erreurs de code (mais il en reste une)
Ecourté le test d'environ 30%

j'obtiens le tous en 155 secondes sur la config suivante:
Debian 6(Squeeze) 64bits
Mysql 5.1.49-3
Php 5.3.3-7
Apache 2.2.16

Processeur I7 2600 / 4Go DDR3 / SSD Crucial C300 64Go

Chaque sous test ne dur pas plus de 20s sur cette config.
Le temps d'ecriture petit fichier et gros est le meme, on verra si il est pas égale sur vos config.

Code :
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
 
<?php
 
error_reporting(E_ALL);
 
date_default_timezone_set("Europe/Paris");
 
ini_set('max_execution_time', 0);
 
ob_implicit_flush(true);
 
 
 
$t_start = time();
 
$nombre_type_test = 12;
 
define('indice_global',0);
 
 
 
 function Initialize($gauche,$haut,$largeur,$hauteur,$bord_col,$txt_col,$bg_col)
 
 {
 
 $tailletxt=$hauteur-10;
 
 // premiere barre
 
 echo '<div id="pourcentage_global" style="position:absolute;top:'.$haut;
 
 echo ';left:'.$gauche;
 
 echo ';width:'.$largeur.'px';
 
 echo ';height:'.$hauteur.'px;border:1px solid '.$bord_col.';font-family:Tahoma;font-weight:bold';
 
 echo ';font-size:'.$tailletxt.'px;color:'.$txt_col.';z-index:1;text-align:center;">0%</div>';
 
 
 
 echo '<div id="progrbar_global" style="position:absolute;top:'.($haut+1); //+1
 
 echo ';left:'.($gauche+1); //+1
 
 echo ';width:0px';
 
 echo ';height:'.$hauteur.'px';
 
 echo ';background-color:'.$bg_col.';z-index:0;"></div>';
 
 
 
 // titre
 
 echo '<div id="titre" style="position:absolute;top:130">titre</div>'; 
 
 // seconde barre
 
 $haut = $haut +100;
 
 echo '<div id="pourcentage" style="position:absolute;top:'.$haut;
 
 echo ';left:'.$gauche;
 
 echo ';width:'.$largeur.'px';
 
 echo ';height:'.$hauteur.'px;border:1px solid '.$bord_col.';font-family:Tahoma;font-weight:bold';
 
 echo ';font-size:'.$tailletxt.'px;color:'.$txt_col.';z-index:1;text-align:center;">0%</div>';
 
 
 
 echo '<div id="progrbar" style="position:absolute;top:'.($haut+1); //+1
 
 echo ';left:'.($gauche+1); //+1
 
 echo ';width:0px';
 
 echo ';height:'.$hauteur.'px';
 
 echo ';background-color:'.$bg_col.';z-index:0;"></div>';
 
 
 
 }
 
 function ProgressBar($indice,$indice_global,$titre)
 
 {
 
 echo "\n<script>";
 
 echo "document.getElementById(\"titre\").innerHTML='".$titre."';";
 
 echo "document.getElementById(\"pourcentage_global\").innerHTML='".$indice_global."%';";
 
 echo "document.getElementById('progrbar_global').style.width=".($indice_global*2).";\n";
 
 echo "document.getElementById(\"pourcentage\").innerHTML='".$indice."%';";
 
 echo "document.getElementById('progrbar').style.width=".($indice*2).";\n";
 
 echo "</script>";
 
 flush();
 
 }
 
 
 
function progression($i,$d,$titre)
 
 {
 
 global $nombre_type_test;
 
 if(!isset($GLOBALS[md5($titre)])) { $GLOBALS[md5($titre)] = 0; }
 
 $pourcent = (100/$d)*$i;
 
 
 
 $GLOBALS[indice_global] = $GLOBALS[indice_global] + ((100/$d)/$nombre_type_test);
 
 
 
 if(intval($pourcent) > $GLOBALS[md5($titre)])
 
  {
 
  //print '<br>'.$titre.' : '.intval($pourcent).' / '.intval($GLOBALS[indice_global]);
 
  ProgressBar(intval($pourcent),intval($GLOBALS[indice_global]),$titre);
 
  }
 
 $GLOBALS[md5($titre)] = intval($pourcent);
 
 }
 
 ?>
 
 <html>
 
 <body>
 
 <?php
 
 Initialize(50,60,200,30,'#000000','#FFCC00','#006699'); // initialisation de la barre de progression
 
 ?>
 
 </body>
 
 </html> 
 
 
 
 
 
<?
 
 
 
//********************************************************************
 
//*** LAMP BENCH 2010 par myz-rix ************************************
 
//********************************************************************
 
 
 
 
 
//********************************************************************
 
//********************************************************************
 
//********************* CONFIGURATION MYSQL **************************
 
//********************************************************************
 
//********************************************************************
 
 
 
$mysql_host ="localhost";
 
$mysql_user ="root";
 
$mysql_pass ="";
 
$mysql_base = "bench";
 
 
 
//********************************************************************
 
//********************************************************************
 
//********************************************************************
 
//********************************************************************
 
//********************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
$progression_i = 0;
 
$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());
 
mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die(mysql_error());
 
 
 
foreach($MYSQL_MOTEUR_ARRAY as $MYSQL_MOTEUR)
 
{//96585
 
//****************************************************************
 
//*** ECRITURE *** 
 
//****************************************************************
 
$mysql_ecriture_i = 50000*$hard;
 
${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'} = time();
 
 
 
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 = 0; $i < $mysql_ecriture_i;$i++)
 
 {
 
 $id = 1000000000 + 978;
 
 progression($i,$mysql_ecriture_i,"MYSQL ".$MYSQL_MOTEUR.": Enregistrement"); 
 
 mysql_query("INSERT INTO `$mysql_base`.`table` (i,v,d) VALUES ('$id','".md5($id)."','".($id/100000000000000)."')") or die(mysql_error());
 
 }
 
 
 
${'t_mysql_ecriture_'.$MYSQL_MOTEUR} = time()- ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'};
 
$t_total = $t_total + ${'t_mysql_ecriture_'.$MYSQL_MOTEUR};
 
 
 
//****************************************************************
 
//*** RECHERCHE VARCHAR *** 
 
//****************************************************************
 
$recherche_i = $hard*70000;
 
${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'} = time();
 
for($i = 0; $i < ($recherche_i);$i++)
 
 {
 
 progression($i,$recherche_i,"MYSQL ".$MYSQL_MOTEUR.": Recherche Varchar"); 
 
 $recherche_1978_req = mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE v LIKE '%1978%' ORDER BY v,d,i DESC") or die(mysql_error());
 
 }
 
${'t_mysql_recherche_'.$MYSQL_MOTEUR} = time()- ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'};
 
$t_total = $t_total + ${'t_mysql_recherche_'.$MYSQL_MOTEUR};
 
 
 
//****************************************************************
 
//*** RECHERCHE INT *** 
 
//****************************************************************
 
$recherche_int_i = $hard*30;
 
${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'} = time();
 
for($i = 0; $i < $recherche_int_i;$i++)
 
 {
 
 progression($i,$recherche_int_i,"MYSQL ".$MYSQL_MOTEUR.": Recherche Int"); 
 
 mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE i > 1 ORDER BY i DESC") or die(mysql_error());
 
 }
 
${'t_mysql_recherche_int_'.$MYSQL_MOTEUR} = time()- ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'};
 
$t_total = $t_total + ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR};
 
}//96585
 
 
 
 
 
 
 
//****************************************************************
 
//*** INCREMENTATION *** 
 
//****************************************************************
 
$incrementation_i = 1000000*$hard;
 
$t_incrementation_i = time();
 
for($i = 0; $i < ($incrementation_i);$i++)
 
 {
 
 progression($i,$incrementation_i,"CALCUL: Incrementation");
 
 }
 
$t_incrementation = time() - $t_incrementation_i;
 
$t_total = $t_total + $t_incrementation;
 
 
 
//****************************************************************
 
//*** MATHEMATIQUE *** 
 
//****************************************************************
 
$t_mathematique_i = time();
 
$mathematique_i = 1000000*$hard;
 
for($i = 0; $i < ($mathematique_i);$i++)
 
 {
 
 progression($i,$mathematique_i,"CALCUL: Mathematique"); 
 
 sqrt($i);
 
 sin($i);
 
 decbin($i);
 
 dechex($i);
 
 }
 
$t_mathematique = time() - $t_mathematique_i;
 
$t_total = $t_total + $t_mathematique; 
 
 
 
//****************************************************************
 
//*** ECRITURE DISQUE *** 
 
//****************************************************************
 
$t_disque_w_i = time();
 
$disque_w_i = 60000*$hard;
 
for($i = 0; $i < ($disque_w_i);$i++)
 
 {
 
 progression($i,$disque_w_i,"DISQUE : Ecriture petit fichier"); 
 
 $fichier = fopen("./test.csv",'w+');
 
 fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
 
 fclose($fichier);
 
 }
 
$t_disque_w = time() - $t_disque_w_i;
 
$t_total = $t_total + $t_disque_w;
 
 
 
//****************************************************************
 
//*** DISQUE LECTURE*** 
 
//****************************************************************
 
$t_disque_r_i = time();
 
$disque_r_i = 400000*$hard;
 
for($i = 0; $i < ($disque_r_i);$i++)
 
 {
 
 progression($i,$disque_r_i,"DISQUE : Lecture petit fichier"); 
 
 $fichier = fopen("./test.csv",'r');
 
 fclose($fichier);
 
 }
 
$t_disque_r = time() - $t_disque_r_i;
 
$t_total = $t_total + $t_disque_r;
 
 
 
 
 
//****************************************************************
 
//*** ECRITURE DISQUE  GROS FICHIER*** 
 
//****************************************************************
 
$boucle_i = 5;
 
$t_disque_gw_i = time();
 
$disque_gw_i = $boucle_i*$hard;
 
for($x = 0; $x < ($disque_gw_i);$x++)
 
{
 
progression($x,$disque_gw_i,"DISQUE : Ecriture gros fichier");
 
 
 
@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 = time() - $t_disque_gw_i;
 
$t_total = $t_total + $t_disque_gw;
 
 
 
 
 
//****************************************************************
 
//*** DISQUE LECTURE GROS FICHIER*** 
 
//****************************************************************
 
$t_disque_gr_i = time();
 
$disque_gr_i = $boucle_i*70000*$hard;
 
for($i = 0; $i < ($disque_gr_i);$i++)
 
 {
 
 progression($i,$disque_gr_i,"DISQUE : Lecture gros fichier");
 
 $fichier = fopen("./test_g.csv",'r');
 
 fclose($fichier);
 
 }
 
$t_disque_gr = time() - $t_disque_gr_i;
 
$t_total = $t_total + $t_disque_gr;
 
 
 
 
 
 
 
 
 
//*********************
 
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></Tr>';
 
print '<tr><td>MYSQL recherche varchar</td><td align="right">'.${'t_mysql_recherche_'.$MYSQL_MOTEUR}.'s</td></Tr>';
 
print '<tr><td>MYSQL recherche int</td><td align="right">'.${'t_mysql_recherche_int_'.$MYSQL_MOTEUR}.'s</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></Tr>';
 
print '<tr><td>MATHEMATIQUE</td><td align="right">'.$t_mathematique.'s</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></Tr>';
 
print '<tr><td>DISQUE Lecture</td><td align="right">'.$t_disque_r.'s</td></Tr>';
 
print '<tr><td>DISQUE Ecriture Gros fichier</td><td align="right">'.$t_disque_gw.'s</td></Tr>';
 
print '<tr><td>DISQUE Lecture Gros fichier</td><td align="right">'.$t_disque_gr.'s</td></Tr>';
 
 
 
print '<tr><td colspan=20 align="right"><center><b>TEMPS '.($t_total).'s</td></tr>';
 
print '</table>';
 
 
 
 
 
 
 
 
 
?>
Si vous pouvez le tester s'il vous plait et meme me dire ou mon code plante.
Merci
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/03/2011, 16h29   #13
Modérateur
 
Inscription : septembre 2010
Messages : 7 101
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 101
Points : 8 466
Points : 8 466
y'a toujours le <? qui traine
j'ai aussi :
Code :
Notice: Undefined offset: 0 in C:\www\test\index.php on line 122
EDIT 1 : l'id pour le INSERT INTO est toujours le même c'est voulu ?
EDIT 2 : toujours pas d'INDEX ? Handler_read_rnd et Handler_read_rnd_next pleurent
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/03/2011, 20h12   #14
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
Erreur de ma part pour l'id identique, j'ai corrigé, je te remercie.
Apres reflexion j'ai pas mis d'index car le but est de le faire trimer un peu, pas de l'optimiser.

Parcontre j'ai cette erreur que j'arrive pas a enlever, je pourrai la masquer, mais j'aimerai bien la résoudre.


Citation:
<?php

error_reporting(E_ALL);

date_default_timezone_set("Europe/Paris");

ini_set('max_execution_time', 0);

ob_implicit_flush(true);



$t_start = time();

$nombre_type_test = 12;

define('indice_global',0);



function Initialize($gauche,$haut,$largeur,$hauteur,$bord_col,$txt_col,$bg_col)

{

$tailletxt=$hauteur-10;

// premiere barre

echo '<div id="pourcentage_global" style="position:absolute;top:'.$haut;

echo ';left:'.$gauche;

echo ';width:'.$largeur.'px';

echo ';height:'.$hauteur.'px;border:1px solid '.$bord_col.';font-family:Tahoma;font-weight:bold';

echo ';font-size:'.$tailletxt.'px;color:'.$txt_col.';z-index:1;text-align:center;">0%</div>';



echo '<div id="progrbar_global" style="position:absolute;top:'.($haut+1); //+1

echo ';left:'.($gauche+1); //+1

echo ';width:0px';

echo ';height:'.$hauteur.'px';

echo ';background-color:'.$bg_col.';z-index:0;"></div>';



// titre

echo '<div id="titre" style="position:absolute;top:130">titre</div>';

// seconde barre

$haut = $haut +100;

echo '<div id="pourcentage" style="position:absolute;top:'.$haut;

echo ';left:'.$gauche;

echo ';width:'.$largeur.'px';

echo ';height:'.$hauteur.'px;border:1px solid '.$bord_col.';font-family:Tahoma;font-weight:bold';

echo ';font-size:'.$tailletxt.'px;color:'.$txt_col.';z-index:1;text-align:center;">0%</div>';



echo '<div id="progrbar" style="position:absolute;top:'.($haut+1); //+1

echo ';left:'.($gauche+1); //+1

echo ';width:0px';

echo ';height:'.$hauteur.'px';

echo ';background-color:'.$bg_col.';z-index:0;"></div>';



}

function ProgressBar($indice,$indice_global,$titre)

{

echo "\n<script>";

echo "document.getElementById(\"titre\").innerHTML='".$titre."';";

echo "document.getElementById(\"pourcentage_global\").innerHTML='".$indice_global."%';";

echo "document.getElementById('progrbar_global').style.width=".($indice_global*2).";\n";

echo "document.getElementById(\"pourcentage\").innerHTML='".$indice."%';";

echo "document.getElementById('progrbar').style.width=".($indice*2).";\n";

echo "</script>";

flush();

}



function progression($i,$d,$titre)

{

global $nombre_type_test;

if(!isset($GLOBALS[md5($titre)])) { $GLOBALS[md5($titre)] = 0; }

$pourcent = (100/$d)*$i;



$GLOBALS[indice_global] = $GLOBALS[indice_global] + ((100/$d)/$nombre_type_test);



if(intval($pourcent) > $GLOBALS[md5($titre)])

{

//print '<br>'.$titre.' : '.intval($pourcent).' / '.intval($GLOBALS[indice_global]);

ProgressBar(intval($pourcent),intval($GLOBALS[indice_global]),$titre);

}

$GLOBALS[md5($titre)] = intval($pourcent);

}

?>

<html>

<body>

<?php Initialize(50,60,200,30,'#000000','#FFCC00','#006699'); // initialisation de la barre de progression ?>

</body>

</html>

<?php


//********************************************************************

//*** LAMP BENCH 2011 par myz-rix ************************************

//********************************************************************





//********************************************************************

//********************************************************************

//********************* CONFIGURATION MYSQL **************************

//********************************************************************

//********************************************************************



$mysql_host ="localhost";

$mysql_user ="root";

$mysql_pass ="";

$mysql_base = "bench";



//********************************************************************

//********************************************************************

//********************************************************************

//********************************************************************

//********************************************************************

















$progression_i = 0;

$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());

mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die(mysql_error());



foreach($MYSQL_MOTEUR_ARRAY as $MYSQL_MOTEUR)

{//96585

//****************************************************************

//*** ECRITURE ***

//****************************************************************

$mysql_ecriture_i = 50000*$hard;

${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'} = time();



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());

$id = 1000000000;

for($i = 0; $i < $mysql_ecriture_i;$i++)

{

$id = $id + 978;

progression($i,$mysql_ecriture_i,"MYSQL ".$MYSQL_MOTEUR.": Enregistrement");

mysql_query("INSERT INTO `$mysql_base`.`table` (i,v,d) VALUES ('$id','".md5($id)."','".($id/100000000000000)."')") or die(mysql_error());

}



${'t_mysql_ecriture_'.$MYSQL_MOTEUR} = time()- ${'t_mysql_ecriture_'.$MYSQL_MOTEUR.'_i'};

$t_total = $t_total + ${'t_mysql_ecriture_'.$MYSQL_MOTEUR};



//****************************************************************

//*** RECHERCHE VARCHAR ***

//****************************************************************

$recherche_i = $hard*70000;

${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'} = time();

for($i = 0; $i < ($recherche_i);$i++)

{

progression($i,$recherche_i,"MYSQL ".$MYSQL_MOTEUR.": Recherche Varchar");

$recherche_1978_req = mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE v LIKE '%1978%' ORDER BY v,d,i DESC") or die(mysql_error());

}

${'t_mysql_recherche_'.$MYSQL_MOTEUR} = time()- ${'t_mysql_recherche_'.$MYSQL_MOTEUR.'_i'};

$t_total = $t_total + ${'t_mysql_recherche_'.$MYSQL_MOTEUR};



//****************************************************************

//*** RECHERCHE INT ***

//****************************************************************

$recherche_int_i = $hard*30;

${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'} = time();

for($i = 0; $i < $recherche_int_i;$i++)

{

progression($i,$recherche_int_i,"MYSQL ".$MYSQL_MOTEUR.": Recherche Int");

mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE i > 1 ORDER BY i DESC") or die(mysql_error());

}

${'t_mysql_recherche_int_'.$MYSQL_MOTEUR} = time()- ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR.'_i'};

$t_total = $t_total + ${'t_mysql_recherche_int_'.$MYSQL_MOTEUR};

}//96585







//****************************************************************

//*** INCREMENTATION ***

//****************************************************************

$incrementation_i = 1000000*$hard;

$t_incrementation_i = time();

for($i = 0; $i < ($incrementation_i);$i++)

{

progression($i,$incrementation_i,"CALCUL: Incrementation");

}

$t_incrementation = time() - $t_incrementation_i;

$t_total = $t_total + $t_incrementation;



//****************************************************************

//*** MATHEMATIQUE ***

//****************************************************************

$t_mathematique_i = time();

$mathematique_i = 1000000*$hard;

for($i = 0; $i < ($mathematique_i);$i++)

{

progression($i,$mathematique_i,"CALCUL: Mathematique");

sqrt($i);

sin($i);

decbin($i);

dechex($i);

}

$t_mathematique = time() - $t_mathematique_i;

$t_total = $t_total + $t_mathematique;



//****************************************************************

//*** ECRITURE DISQUE ***

//****************************************************************

$t_disque_w_i = time();

$disque_w_i = 60000*$hard;

for($i = 0; $i < ($disque_w_i);$i++)

{

progression($i,$disque_w_i,"DISQUE : Ecriture petit fichier");

$fichier = fopen("./test.csv",'w+');

fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");

fclose($fichier);

}

$t_disque_w = time() - $t_disque_w_i;

$t_total = $t_total + $t_disque_w;



//****************************************************************

//*** DISQUE LECTURE***

//****************************************************************

$t_disque_r_i = time();

$disque_r_i = 400000*$hard;

for($i = 0; $i < ($disque_r_i);$i++)

{

progression($i,$disque_r_i,"DISQUE : Lecture petit fichier");

$fichier = fopen("./test.csv",'r');

fclose($fichier);

}

$t_disque_r = time() - $t_disque_r_i;

$t_total = $t_total + $t_disque_r;





//****************************************************************

//*** ECRITURE DISQUE GROS FICHIER***

//****************************************************************

$boucle_i = 5;

$t_disque_gw_i = time();

$disque_gw_i = $boucle_i*$hard;

for($x = 0; $x < ($disque_gw_i);$x++)

{

progression($x,$disque_gw_i,"DISQUE : Ecriture gros fichier");



@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 = time() - $t_disque_gw_i;

$t_total = $t_total + $t_disque_gw;





//****************************************************************

//*** DISQUE LECTURE GROS FICHIER***

//****************************************************************

$t_disque_gr_i = time();

$disque_gr_i = $boucle_i*70000*$hard;

for($i = 0; $i < ($disque_gr_i);$i++)

{

progression($i,$disque_gr_i,"DISQUE : Lecture gros fichier");

$fichier = fopen("./test_g.csv",'r');

fclose($fichier);

}

$t_disque_gr = time() - $t_disque_gr_i;

$t_total = $t_total + $t_disque_gr;









//*********************

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></Tr>';

print '<tr><td>MYSQL recherche varchar</td><td align="right">'.${'t_mysql_recherche_'.$MYSQL_MOTEUR}.'s</td></Tr>';

print '<tr><td>MYSQL recherche int</td><td align="right">'.${'t_mysql_recherche_int_'.$MYSQL_MOTEUR}.'s</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></Tr>';

print '<tr><td>MATHEMATIQUE</td><td align="right">'.$t_mathematique.'s</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></Tr>';

print '<tr><td>DISQUE Lecture</td><td align="right">'.$t_disque_r.'s</td></Tr>';

print '<tr><td>DISQUE Ecriture Gros fichier</td><td align="right">'.$t_disque_gw.'s</td></Tr>';

print '<tr><td>DISQUE Lecture Gros fichier</td><td align="right">'.$t_disque_gr.'s</td></Tr>';



print '<tr><td colspan=20 align="right"><center><b>TEMPS '.($t_total).'s</td></tr>';

print '</table>';









?>


T'as optimiser qu'elle timing ?
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/03/2011, 23h22   #15
Modérateur
 
Inscription : septembre 2010
Messages : 7 101
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 101
Points : 8 466
Points : 8 466
pour l'erreur c'est le 1er $GLOBALS[indice_global] qui n'existe pas, en même temps global ça s'utilise plus (c'est voué à disparaitre en plus)

en tout ca je sais pas comment t'arrive a avoir des score si bas, mais l'étape 2 (varchar)est vraiment vraiment longue dans tout les env que j'ai tester (même avec du mysql 5.5 64bit, tu me diras j'ai pas de SSD ca joue surement mais peu être pas autant)

sinon t'as toujours une erreur lorsque tu fais ton premiere DROP BASE (normale elle n'existe pas, rajoute un IF EXISTS)

Citation:
Envoyé par myz-rix Voir le message
Apres reflexion j'ai pas mis d'index car le but est de le faire trimer un peu, pas de l'optimiser.
la c'est pareil que si tu testais un moteur de voiture en restant en 1ère (oui elle trime mais tu testes pas les vrais performances)
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 10/03/2011, 06h50   #16
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
Tres bon exemple pour la voiture, je vais mettre un index

Je peux baser les test sur un Q8200 avec avec disque dur normal si tu veux, le probleme c'est que quand on test sur une autre machine plus puissante comme l'autre que j'ai beinh les sous test dur moins d'une seconde donc dur de comparer apres.

Je regle tout pour que le test dur mois de 200s sur un Q8200, vu que t'as un i5 les scores devrait etre similaire, seule l'install jouera.
Sinon ya une variable "hard" que tu peux mettre a 0.5 si tu veux, ça permet que ce soit moins long (attention resultat decroissant de maniere expodentielle) , je ferai un test à 0.5 aussi.

Sinon y a une autre maniere de proceder qui est:
chaque test dur X secondes, on regarde combien d'evenement on était réalisé dans ce labs de temps, et on calcul une moyenne. ça sauvera certain d'une attente interminable.
Mais si un test n'aboutit pas au bout des X secondes ça sera = à 0 donc pas comparable non plus (repense à son win qui met 22 500s contre 180s)

niveau prog faudrait que je mette à jour j'avoue
Tu penses que le mieux a faire c'est quoi pour que ça tourne sur ta config ?
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/03/2011, 09h33   #17
Membre émérite
 
Avatar de vorace
 
Homme
Développeur
Inscription : août 2010
Messages : 586
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : Développeur

Informations forums :
Inscription : août 2010
Messages : 586
Points : 859
Points : 859
mets un index, j'ai lancé le test et au bout de plus de 3 heures j'avais que 35% d'effectué...c'est surtout la recherche varchar qui peche, sans index c'est une torture...
pour info (xampp):
PHP Version 5.3.5
mysqlnd 5.0.7
__________________
Développeur informatique contrarié...
vorace est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 10/03/2011, 10h25   #18
Modérateur
 
Inscription : septembre 2010
Messages : 7 101
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 101
Points : 8 466
Points : 8 466
pour les config rapides utilise microtime plutôt
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 11/03/2011, 07h41   #19
Membre du Club
 
Avatar de myz-rix
 
Inscription : janvier 2008
Messages : 104
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2008
Messages : 104
Points : 61
Points : 61
Envoyer un message via MSN à myz-rix Envoyer un message via Skype™ à myz-rix
Par défaut Version 2, révision complet du code

Bon j'ai revu tout le code,

Durée maximum du test 3 Minutes !
Si config vraiement trop lente, possibilité d'augmenter ce temps,
rendant aussi le test plus précis et ne faussant pas le résultat.

J'ai pas encore mis l'INDEX, j'aimerai faire un test avec et sans, faut que je code encore.

1224s => DEBIAN 6(Squeeze) 64Bits - CPU INTEL I7 2600 - HDD SSD CRUTIAL C300 64Go - 4Go DDR3
3661s => UBUNTU 9.1 32Bits en virtual box sur config ci-dessus hébergé sur clef usb
6690s => UBUNTU ci dessus en virtual box mais sur un CPU INTEL Q8200

Parcontre, j'ai vraiement du mal avec les définitions des variables, je m'en sors pas, ça me met des erreurs de partout. (^E_NOTICE)

Code :
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
 
<?php
//********************************************************************
//*** LAMP BENCH 2010 par myz-rix ************************************
//********************************************************************
// 1224s => DEBIAN 6(Squeeze) 64Bits - CPU INTEL I7 2600 - HDD SSD CRUTIAL C300 64Go - 4Go DDR3
// 3661s => UBUNTU 9.1 32Bits en virtual box sur config ci-dessus hébergé sur clef usb
 
//********************************************************************
//********************************************************************
//********************* CONFIGURATION MYSQL **************************
//********************************************************************
//********************************************************************
 
$mysql_host ="localhost";
$mysql_user ="root";
$mysql_pass ="";
$mysql_base = "bench";
 
$duree_total_du_test = 180; // en seconde
//********************************************************************
//********************************************************************
//********************************************************************
//********************************************************************
//********************************************************************
 
 
 
error_reporting(E_ALL ^E_ALL);
session_start();
 
date_default_timezone_set("Europe/Paris");
ini_set('max_execution_time', 0);
ob_implicit_flush(true);
$t_start = microtime(true);
$nombre_type_test = 12;
 
 
define("mysql_id",0);
define("indice_global",1);
define("i",2);
$indice_global = 0;
//$mysql_id = 0;
$_SESSION[indice_global]=0;
 
 
 function Initialize($gauche,$haut,$largeur,$hauteur,$bord_col,$txt_col,$bg_col)
 {
 $tailletxt=$hauteur-10;
 // premiere barre
 echo '<div id="pourcentage_global" style="position:absolute;top:'.$haut;
 echo ';left:'.$gauche;
 echo ';width:'.$largeur.'px';
 echo ';height:'.$hauteur.'px;border:1px solid '.$bord_col.';font-family:Tahoma;font-weight:bold';
 echo ';font-size:'.$tailletxt.'px;color:'.$txt_col.';z-index:1;text-align:center;">0%</div>';
 
 echo '<div id="progrbar_global" style="position:absolute;top:'.($haut+1); //+1
 echo ';left:'.($gauche+1); //+1
 echo ';width:0px';
 echo ';height:'.$hauteur.'px';
 echo ';background-color:'.$bg_col.';z-index:0;"></div>';
 
 // titre
 echo '<div id="titre" style="position:absolute;top:130">titre</div>'; 
 // seconde barre
 
 $haut = $haut +100;
 echo '<div id="pourcentage" style="position:absolute;top:'.$haut;
 echo ';left:'.$gauche;
 echo ';width:'.$largeur.'px';
 echo ';height:'.$hauteur.'px;border:1px solid '.$bord_col.';font-family:Tahoma;font-weight:bold';
 echo ';font-size:'.$tailletxt.'px;color:'.$txt_col.';z-index:1;text-align:center;">0%</div>';
 
 echo '<div id="progrbar" style="position:absolute;top:'.($haut+1); //+1
 echo ';left:'.($gauche+1); //+1
 echo ';width:0px';
 echo ';height:'.$hauteur.'px';
 echo ';background-color:'.$bg_col.';z-index:0;"></div>';
 }
 
 function ProgressBar($indice,$indice_global_i,$titre)
 {
 echo "\n<script>";
 echo "document.getElementById(\"titre\").innerHTML='".$titre."';";
 echo "document.getElementById(\"pourcentage_global\").innerHTML='".$indice_global_i."%';";
 echo "document.getElementById('progrbar_global').style.width=".($indice_global_i*2).";\n";
 echo "document.getElementById(\"pourcentage\").innerHTML='".$indice."%';";
 echo "document.getElementById('progrbar').style.width=".($indice*2).";\n";
 echo "</script>";
 flush();
 }
 
 
function progression($i,$d,$titre)
 {
 global $nombre_type_test;
 if(!isset($_SESSION[md5($titre)])) { $_SESSION[md5($titre)] = 0; }
 $pourcent = (100/$d)*$i;
 
 if(intval($pourcent) > $_SESSION[md5($titre)])
  {
 
 $_SESSION[indice_global] = $_SESSION[indice_global] + (1/$nombre_type_test);
  //print '<br>'.$titre.' : '.intval($pourcent).' / '.intval($_SESSION[indice_global]);
  ProgressBar(intval($pourcent),intval($_SESSION[indice_global]),$titre);
  }
 $_SESSION[md5($titre)] = intval($pourcent);
 }
?>
 <html>
 <body>
 <?php  Initialize(50,60,200,30,'#000000','#FFCC00','#006699'); // initialisation de la barre de progression ?>
 </body>
 </html> 
<?php
 
$duree_chaque_test = $duree_total_du_test / $nombre_type_test;
 
 
 
for($i=0;$i < 10;$i++) { print '<br>'; }
 
$temps_total = 0;
$progression_i = 0;
$hard = 0.1; // 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());
mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die(mysql_error());
 
 
$test_array = array(
"MYSQL_MEMORY_ECRITURE" => "1974813",
"MYSQL_MEMORY_RECHERCHE_INT" => "97691",
"MYSQL_MEMORY_RECHERCHE_CHAR" => "3300326",
"MYSQL_MYISAM_ECRITURE" => "1974813",
"MYSQL_MYISAM_RECHERCHE_INT" => "97691",
"MYSQL_MYISAM_RECHERCHE_CHAR" => "3300326",
"INCREMENTATION" => "2950373",
"MATHEMATIQUE" => "17022498",
"DISQUE_PETIT_FICHIER_ECRITURE" => "2023181",
"DISQUE_PETIT_FICHIER_LECTURE" => "8320878",
"DISQUE_GROS_FICHIER_ECRITURE" => "288",
"DISQUE_GROS_FICHIER_LECTURE" => "9671166"
);
 
 
 
// *********************************
// *** TEST
// *********************************
// *** MYSQL TEST MEMORY
function MYSQL_MEMORY_ECRITURE()
 {
 global $mysql_base;
 $_SESSION[mysql_id] = $_SESSION[mysql_id] + 978;
 mysql_query("INSERT INTO `$mysql_base`.`table` (i,v,d) VALUES ('$_SESSION[mysql_id]','".md5($_SESSION[mysql_id])."','".($_SESSION[mysql_id]/100000000000000)."')") or die(mysql_error());
 }
 
function MYSQL_MEMORY_RECHERCHE_INT()
{
global $mysql_base;
mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE i > 1 ORDER BY i DESC") or die(mysql_error());
}
 
function MYSQL_MEMORY_RECHERCHE_CHAR()
{
global $mysql_base;
mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE v LIKE '%1978%' ORDER BY v,d,i DESC") or die(mysql_error());
}
// *** MYSQL TEST MYISAM => IDENTIQUE MEMORY
function MYSQL_MYISAM_ECRITURE()
 {
 global $mysql_base;
 $_SESSION[mysql_id] = $_SESSION[mysql_id] + 978;
 mysql_query("INSERT INTO `$mysql_base`.`table` (i,v,d) VALUES ('$_SESSION[mysql_id]','".md5($_SESSION[mysql_id])."','".($_SESSION[mysql_id]/100000000000000)."')") or die(mysql_error());
 }
 
function MYSQL_MYISAM_RECHERCHE_INT()
{
global $mysql_base;
mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE i > 1 ORDER BY i DESC") or die(mysql_error());
}
 
function MYSQL_MYISAM_RECHERCHE_CHAR()
{
global $mysql_base;
mysql_query("SELECT * FROM `$mysql_base`.`table` WHERE v LIKE '%1978%' ORDER BY v,d,i DESC") or die(mysql_error());
}
// *** AUTRES TEST
function INCREMENTATION()
{
//if(!defined("i")) {define("i",4);}
for($i = 0; $i < 1000;$i++) { }
}
 
function MATHEMATIQUE()
{
 sqrt($i);
 sin($i);
 decbin($i);
 dechex($i);
}
 
function DISQUE_PETIT_FICHIER_ECRITURE()
{
 @unlink("./test.csv");
 $fichier = fopen("./test.csv",'w+');
 fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
 fclose($fichier);
}
 
function DISQUE_PETIT_FICHIER_LECTURE()
{
 $fichier = fopen("./test.csv",'r');
 fclose($fichier);
}
 
function DISQUE_GROS_FICHIER_ECRITURE()
{
@unlink("./test_g.csv");
$fichier = fopen("./test_g.csv",'w+');
for($i = 0; $i < (100000);$i++)
 {
 fputs($fichier,"\r\n"."a4bcaee7d57e19735590b480feaebddb");
 }
fclose($fichier);
 
}
 
function DISQUE_GROS_FICHIER_LECTURE()
{
 $fichier = fopen("./test_g.csv",'r');
 fclose($fichier);
}
 
 
 
 
 
//**************************************************************
 
foreach($test_array as $test=>$coef)
{
 
if($test == "MYSQL_MEMORY_ECRITURE" || $test == "MYSQL_MYISAM_ECRITURE" )
{
$_SESSION[mysql_id] = 1000000000;
$MYSQL_MOTEUR = substr($test,6,6);
//print '<br>MOTEUR:'.$MYSQL_MOTEUR;
mysql_query("DROP DATABASE IF EXISTS `$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());
}
 
//********************************************************************
// *** BOUCLE *** DEB
${$test.'_microtime_deb'} = microtime(true);
$cycle_i=0;
 
while(microtime(true) < (${$test.'_microtime_deb'}+$duree_chaque_test))
 {
 $test();
 progression((microtime(true)-${$test.'_microtime_deb'}),$duree_chaque_test,$test); 
 $cycle_i++;
 }
${$test.'_microtime_fin'} = microtime(true);
${$test.'_cycle_par_seconde'} = $cycle_i / (${$test.'_microtime_fin'}-${$test.'_microtime_deb'});
${$test.'_coef_temps'} = $coef / ${$test.'_cycle_par_seconde'};
$temps_total = $temps_total + ${$test.'_coef_temps'};
 
// *** MYSQL 10.000 ENREGISTREMENT - on s'assure qu'il y a bien 10.000 enregistrement pour les test de recherche
if($test == "MYSQL_MEMORY_ECRITURE" || $test == "MYSQL_MYISAM_ECRITURE" )
{
$mysql_num_rows = mysql_num_rows(mysql_query("SELECT i FROM ".$mysql_base.".table"));
if($mysql_num_rows > 10000)
 {
 mysql_query("DELETE FROM ".$mysql_base.".table WHERE i > ".(1000000000+(10000*978))."");
 }
else
 {
 print '<br><font color="ff0000"><b>ENREGISTREMENT MYSQL FAIBLE, veuillez augmenter la duree du test totale à:  '.round(((10000/${$test.'_cycle_par_seconde'})*12*1.10),0).'s</font></b>';
 }
}
// *** BOUCLE *** FIN
//*********************************************************************
 
print '<br>'.$test.': '.round(${$test.'_cycle_par_seconde'},0).'c/s => <font color="0000ff">'.round(${$test.'_coef_temps'},0).'s</font> pour '.$coef.' cycles';
//print ' / '.round((100/(${$test.'_coef_temps'})*$coef),0).'</font>';
}
 
print '<br><br><b><font color="0000ff">TEMPS EVALUATION = '.round($temps_total,0).'s</b></font>';
 
//*********************
mysql_query("DROP DATABASE `$mysql_base`");
unlink("./test_g.csv");
unlink("./test.csv");
session_destroy();
//*********************
 
?>
myz-rix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/03/2011, 12h53   #20
Membre émérite
 
Avatar de vorace
 
Homme
Développeur
Inscription : août 2010
Messages : 586
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : Développeur

Informations forums :
Inscription : août 2010
Messages : 586
Points : 859
Points : 859
nickel à part la barre de progression du haut qui indique 93% à la fin et toujours la même fameuse erreur the table `table`is full... et enfin voila les résultats tant attendus...:

Citation:
MYSQL_MEMORY_ECRITURE: 7648c/s => 258s pour 1974813 cycles
MYSQL_MEMORY_RECHERCHE_INT: 63c/s => 1541s pour 97691 cycles
MYSQL_MEMORY_RECHERCHE_CHAR: 31c/s => 106298s pour 3300326 cycles
MYSQL_MYISAM_ECRITURE: 6239c/s => 317s pour 1974813 cycles
MYSQL_MYISAM_RECHERCHE_INT: 45c/s => 2186s pour 97691 cycles
MYSQL_MYISAM_RECHERCHE_CHAR: 28c/s => 116970s pour 3300326 cycles
INCREMENTATION: 10563c/s => 279s pour 2950373 cycles
MATHEMATIQUE: 80274c/s => 212s pour 17022498 cycles
DISQUE_PETIT_FICHIER_ECRITURE: 1567c/s => 1291s pour 2023181 cycles
DISQUE_PETIT_FICHIER_LECTURE: 16376c/s => 508s pour 8320878 cycles
DISQUE_GROS_FICHIER_ECRITURE: 2c/s => 128s pour 288 cycles
DISQUE_GROS_FICHIER_LECTURE: 16842c/s => 574s pour 9671166 cycles

TEMPS EVALUATION = 230562s
je ne suis pas un spécialiste en hardware mais c'est normal d'avoir ces résultats ? je sais que mon pc est un portable mais il m'a quand même couté le prix d'un bon pc de bureau...
et avec xampp 1.7.4 :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
MYSQL_MEMORY_ECRITURE: 6811c/s => 290s pour 1974813 cycles
MYSQL_MEMORY_RECHERCHE_INT: 71c/s => 1373s pour 97691 cycles
MYSQL_MEMORY_RECHERCHE_CHAR: 35c/s => 94684s pour 3300326 cycles
MYSQL_MYISAM_ECRITURE: 5706c/s => 346s pour 1974813 cycles
MYSQL_MYISAM_RECHERCHE_INT: 51c/s => 1906s pour 97691 cycles
MYSQL_MYISAM_RECHERCHE_CHAR: 31c/s => 105977s pour 3300326 cycles
INCREMENTATION: 10342c/s => 285s pour 2950373 cycles
MATHEMATIQUE: 73571c/s => 231s pour 17022498 cycles
DISQUE_PETIT_FICHIER_ECRITURE: 1534c/s => 1319s pour 2023181 cycles
DISQUE_PETIT_FICHIER_LECTURE: 16361c/s => 509s pour 8320878 cycles
DISQUE_GROS_FICHIER_ECRITURE: 2c/s => 128s pour 288 cycles
DISQUE_GROS_FICHIER_LECTURE: 16522c/s => 585s pour 9671166 cycles
 
TEMPS EVALUATION = 207635s
__________________
Développeur informatique contrarié...
vorace est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 03h58.


 
 
 
 
Partenaires

Hébergement Web