~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to fix_innodb_for_backup.patch

some performance tuning

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
                                  mach_read_from_8(read_buf + FIL_PAGE_LSN))
13
13
diff -ru a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
14
14
--- a/innobase/buf/buf0rea.c    2008-12-19 02:19:35.000000000 +0900
15
 
+++ b/innobase/buf/buf0rea.c    2009-04-08 10:52:42.000000000 +0900
 
15
+++ b/innobase/buf/buf0rea.c    2009-04-09 18:18:30.000000000 +0900
16
16
@@ -125,6 +125,45 @@
17
17
        block = buf_page_init_for_read(err, mode, space, tablespace_version,
18
18
                                                                offset);
59
59
                
60
60
                return(0);
61
61
        }
 
62
@@ -684,11 +723,11 @@
 
63
                while (buf_pool->n_pend_reads >= recv_n_pool_free_frames / 2) {
 
64
 
 
65
                        os_aio_simulated_wake_handler_threads();
 
66
-                       os_thread_sleep(500000);
 
67
+                       os_thread_sleep(20000);
 
68
 
 
69
                        count++;
 
70
 
 
71
-                       if (count > 100) {
 
72
+                       if (count > 2500) {
 
73
                                fprintf(stderr,
 
74
 "InnoDB: Error: InnoDB has waited for 50 seconds for pending\n"
 
75
 "InnoDB: reads to the buffer pool to be finished.\n"
62
76
diff -ru a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
63
77
--- a/innobase/fil/fil0fil.c    2008-12-19 02:19:35.000000000 +0900
64
78
+++ b/innobase/fil/fil0fil.c    2009-04-08 10:52:42.000000000 +0900
233
247
                "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
234
248
diff -ru a/innobase/log/log0recv.c b/innobase/log/log0recv.c
235
249
--- a/innobase/log/log0recv.c   2008-12-19 02:19:36.000000000 +0900
236
 
+++ b/innobase/log/log0recv.c   2009-04-08 10:54:53.000000000 +0900
237
 
@@ -35,12 +35,12 @@
 
250
+++ b/innobase/log/log0recv.c   2009-04-09 18:34:45.000000000 +0900
 
251
@@ -35,19 +35,19 @@
238
252
 #include "fil0fil.h"
239
253
 #include "sync0sync.h"
240
254
 
249
263
 
250
264
 /* Log records are stored in the hash table in chunks at most of this size;
251
265
 this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */
 
266
 #define RECV_DATA_BLOCK_SIZE   (MEM_MAX_ALLOC_IN_BUF - sizeof(recv_data_t))
 
267
 
 
268
 /* Read-ahead area in applying log records to file pages */
 
269
-#define RECV_READ_AHEAD_AREA   32
 
270
+#define RECV_READ_AHEAD_AREA   128
 
271
 
 
272
 recv_sys_t*    recv_sys = NULL;
 
273
 ibool          recv_recovery_on = FALSE;
 
274
@@ -101,7 +101,7 @@
 
275
 use these free frames to read in pages when we start applying the
 
276
 log records to the database. */
 
277
 
 
278
-ulint  recv_n_pool_free_frames         = 256;
 
279
+ulint  recv_n_pool_free_frames         = 1024;
 
280
 
 
281
 /* The maximum lsn we see for a page during the recovery process. If this
 
282
 is bigger than the lsn we are able to scan up to, that is an indication that
252
283
@@ -450,7 +450,7 @@
253
284
 
254
285
 /***************************************************************************
346
377
        mem_pool_mutex_enter();
347
378
diff -ru a/innobase/os/os0file.c b/innobase/os/os0file.c
348
379
--- a/innobase/os/os0file.c     2008-12-19 02:19:36.000000000 +0900
349
 
+++ b/innobase/os/os0file.c     2009-04-08 10:52:42.000000000 +0900
 
380
+++ b/innobase/os/os0file.c     2009-04-09 18:22:49.000000000 +0900
350
381
@@ -435,7 +435,7 @@
351
382
 }
352
383
 
356
387
 #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
357
388
 /* InnoDB Hot Backup does not lock the data files.
358
389
  * On Windows, mandatory locking is used.
 
390
@@ -3148,6 +3148,13 @@
 
391
        struct aiocb*   control;
 
392
 #endif
 
393
        ulint           i;
 
394
+       ulint           prim_segment;
 
395
+       ulint           n;
 
396
+
 
397
+       n = array->n_slots / array->n_segments;
 
398
+       /* 64 blocks' striping ( aligning max(BUF_READ_AHEAD_AREA) ) */
 
399
+       prim_segment = ( offset >> (UNIV_PAGE_SIZE_SHIFT + 6) ) % (array->n_segments);
 
400
+
 
401
 loop:
 
402
        os_mutex_enter(array->mutex);
 
403
 
 
404
@@ -3166,6 +3173,16 @@
 
405
                goto loop;
 
406
        }
 
407
 
 
408
+       for (i = prim_segment * n; i < array->n_slots; i++) {
 
409
+               slot = os_aio_array_get_nth_slot(array, i);
 
410
+
 
411
+               if (slot->reserved == FALSE) {
 
412
+                       break;
 
413
+               }
 
414
+       }
 
415
+
 
416
+       if (slot->reserved == TRUE){
 
417
+               /* Not found after the intended segment. So we should search before. */
 
418
        for (i = 0;; i++) {
 
419
                slot = os_aio_array_get_nth_slot(array, i);
 
420
 
 
421
@@ -3173,6 +3190,7 @@
 
422
                        break;
 
423
                }
 
424
        }
 
425
+       }
 
426
 
 
427
        array->n_reserved++;
 
428
 
359
429
diff -ru a/innobase/os/os0thread.c b/innobase/os/os0thread.c
360
430
--- a/innobase/os/os0thread.c   2008-12-19 02:19:36.000000000 +0900
361
431
+++ b/innobase/os/os0thread.c   2009-04-08 10:52:42.000000000 +0900
379
449
 
380
450
diff -ru a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
381
451
--- a/innobase/srv/srv0start.c  2008-12-19 02:19:37.000000000 +0900
382
 
+++ b/innobase/srv/srv0start.c  2009-04-08 10:52:42.000000000 +0900
 
452
+++ b/innobase/srv/srv0start.c  2009-04-09 18:25:02.000000000 +0900
383
453
@@ -61,6 +61,8 @@
384
454
 /* Log sequence number at shutdown */
385
455
 dulint         srv_shutdown_lsn;
407
477
 ulint
408
478
 open_or_create_data_files(
409
479
 /*======================*/
 
480
@@ -1213,12 +1215,12 @@
 
481
 
 
482
        if (!os_aio_use_native_aio) {
 
483
                /* In simulated aio we currently have use only for 4 threads */
 
484
-               srv_n_file_io_threads = 4;
 
485
+               /*srv_n_file_io_threads = 4;*/
 
486
 
 
487
                os_aio_init(8 * SRV_N_PENDING_IOS_PER_THREAD
 
488
                                                * srv_n_file_io_threads,
 
489
                                        srv_n_file_io_threads,
 
490
-                                       SRV_MAX_N_PENDING_SYNC_IOS);
 
491
+                                       SRV_MAX_N_PENDING_SYNC_IOS * 8);
 
492
        } else {
 
493
                os_aio_init(SRV_N_PENDING_IOS_PER_THREAD
 
494
                                                * srv_n_file_io_threads,
410
495
@@ -1275,7 +1277,7 @@
411
496
        }
412
497
 #endif /* UNIV_LOG_ARCHIVE */