Archive for August 20, 2011

Optimizing and Tuning Your Database

Posted: August 20, 2011 in Mysql

4 thing you should know.

  • CPU—The faster the CPU, the faster MySQL will be able to process your data. There’s no real secret to this, but a 750 MHz processor is significantly faster than a 266 MHz processor. With processor speeds now over 1 GHz, and with reasonable prices all around, it’s not difficult to get a good bang for your buck.
  • Memory—Put as much RAM in your machine as you can. You can never have enough, and RAM prices will be at rock bottom for the foreseeable future. Having available RAM can help balance out sluggish CPUs.
  • Hard Drive—The proper hard drive will be both large enough and fast enough to accommodate your database server and its traffic. An important measurement of hard drive speed is its seek time, or the amount of time it takes for the drive to spin around and find a specific piece of information. Seek time is measured in milliseconds, and an average disk seek time is around 8 or 9 milliseconds. When buying a hard drive, make sure it’s big enough to accommodate all the data you’ll eventually store in your database and fast enough to find it quickly.
  • Operating System—If you use an operating system that’s a resource hog, you have two choices: buy enough resources (that is, RAM) so that it doesn’t matter, or use an operating system that doesn’t suck away all your resources just so that you can have windows and pretty colors. Also, if you are blessed with a machine with multiple processors, be sure your operating system can handle this condition and handle it well.

Using the benchmark() Function

A quick test of your server speed is to use the benchmark() MySQL function to see how long it takes to process a given expression. You can make the expression something simple, such as 10 + 10, or something more extravagant, such as extracting pieces of dates.

No matter the result of the expression, the result of benchmark() will always be 0. The purpose of benchmark() is not to retrieve the result of the expression but to see how long it takes to repeat the expression for a specific number of times. For example, the following command executes the expression 10 + 10 one million times:

mysql> SELECT BENCHMARK(1000000,10+10);

+—————————————-+
| BENCHMARK(1000000,10+10) |
+—————————————-+
|                            0 |
+—————————————-+
1 row in set (0.07 sec)

This command executes the date extraction expression, also one million times:

mysql> SELECT BENCHMARK(1000000, EXTRACT(YEAR FROM NOW()));

+———————————————————————–+
| BENCHMARK(1000000, EXTRACT(YEAR FROM NOW())) |
+———————————————————————–+
|                                                       0 |
+———————————————————————–+
1 row in set (0.06 sec)

The important number is the time in seconds, which is the elapsed time for the execution of the function. You may want to run the same uses of benchmark() multiple times during different times of day (when your server is under different loads) to get a better idea of how your server is performing.

Malam Lailatul Qadar

Posted: August 20, 2011 in My live

Petanda Malam Lailatul Qadar

Kata sesetengah ulama, Lailatulqadar berlaku pada satu malam tertentu seperti malam 21 dan 23 Ramadan. Ini menurut Imam Syafie r.a dan sesetengah ulama kerana ada hadis Bukhari dan Muslim yang menceritakan Lailatulqadar berlaku pada malam tersebut sehingga Rasulullah saw sujud dan dahinya yang mulia masih berlumuran tanah pada malam itu. Ada sesetengah ulama, tidak menentukannya secara pasti dan ada juga ulama terutama dari kalangan para zuhad dan sebagainya mengira dengan hari permulaan puasa.
Menurut mereka sekiranya permulaan puasa jatuh pada hari :
  • Ahad atau Rabu = Lailatulqadar ialah pada hari yang ke-29.
  • Jumaat atau Selasa Lailatulqadar ialah pada hari yang ke-27.
  • Khamis = Lailatulqadar ialah pada hari yang ke-25 Ramadan.
  • Sabtu = Lailatulqadar ialah pada hari yang ke-23.
  • Isnin = Lailatulqadar ialah pada hari yang ke-21.
Demikianlah kaedah yang diguna pakai oleh sebahagian ulama termasuk Imam Abul Hasan r.a. Tegas beliau: Aku tidak pernah terlepas malam Lailatulqadar tersebut dengan menggunakan kaedah ini.

Tanda Dan Alamat

Tanda dan alamatnya adalah banyak, antara lain malam itu sendiri berlalu dengan penuh keheningan dan tenteram, angin bertiup lembut sepoi-sepoi bahasa dan esoknya, pada pagi hari kelihatan langit agak redup dan cahaya matahari tidak begitu menyinari ruang angkasa dan macam-macam lagi.

Hikmah

Hikmatnya ialah apabila seseorang mengetahui malam Lailatulqadar tersebut, maka eloklah diperbanyakkan doa dan istighfar juga ibadat pada malam dan keesokannya, untuk mendapatkan fadilat hari yang penuh berkat dan mulia itu. Yakinlah apabila seseorang itu bersedia setiap malam Ramadan dengan ibadat, sekurang-kurangnya bersolat jemaah setiap waktu, Maghrib, Isyak dan Subuh, kata ulama dia pasti memperoleh fadilat malam Lailatulqadar
Oleh itu bersolatlah dengan tekun dan berterusan terutama pada bulan Ramadan al-Mubarak ini. Walau tinggal beberapa hari saja lagi malam-malam di bulan Ramadhan, pastikan kita menjadi juara diakhirnya nanti. Semoga Ramadhan kali ini menjanjikan kita kemenangan. Kemenangan melawan dan menguasai hawa nafsu. InsyaAllah.

Sumber : iLuvislam.com