-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Both InnoDB and PostgreSQL - as well as many other databases - use a technique called multi-version concurrency control (MVCC) to provide transaction isolation: transactions should not see the work of other, uncommitted transactions. MVCC means that, when a row is updated, the database stores both the old and new versions of the row.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Friday, December 23, 2011

Multiple Purpose Expect Script

DISK ALERT - Expect ScriptHi All, here's I have bring a expect script, that this we can Run command on Remote Linux Servers, copy file using SSHSo here it is:
[root@virtual-vm ~]#  yum install expect  (if expect package is not installed)

Monday, November 14, 2011

MPM-Apache-settings

Worker based


StartServers             5
ServerLimit             16
ThreadLimit             35
MaxClients             560
MinSpareThreads         25
MaxSpareThreads         75
ThreadsPerChild         35
MaxRequestsPerChild  25000


Prefork Based:



StartServers          15
MinSpareServers       15
MaxSpareServers       35
MaxClients           100
MaxRequestsPerChild 2500




StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0


# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process

NumServers           5
StartThreads         5
MinSpareThreads      5
MaxSpareThreads     10
MaxThreadsPerChild  20
MaxRequestsPerChild  0


# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum  number of requests a server process serves

ThreadsPerChild 250
MaxRequestsPerChild  0


# BeOS MPM
# StartThreads: how many threads do we initially spawn?
# MaxClients:   max number of threads we can have (1 thread == 1 client)
# MaxRequestsPerThread: maximum number of requests each thread will process

StartThreads               10
MaxClients                 50
MaxRequestsPerThread       10000


# NetWare MPM
# ThreadStackSize: Stack size allocated for each worker thread
# StartThreads: Number of worker threads launched at server startup
# MinSpareThreads: Minimum number of idle threads, to handle request spikes
# MaxSpareThreads: Maximum number of idle threads
# MaxThreads: Maximum number of worker threads alive at the same time
# MaxRequestsPerChild: Maximum  number of requests a thread serves. It is
#                      recommended that the default value of 0 be set for this
#                      directive on NetWare.  This will allow the thread to
#                      continue to service requests indefinitely.                        

ThreadStackSize      65536
StartThreads           250
MinSpareThreads         25
MaxSpareThreads        250
MaxThreads            1000
MaxRequestsPerChild      0
MaxMemFree             100


# OS/2 MPM
# StartServers: Number of server processes to maintain
# MinSpareThreads: Minimum number of idle threads per process,
#                  to handle request spikes
# MaxSpareThreads: Maximum number of idle threads per process
# MaxRequestsPerChild: Maximum number of connections per server process

StartServers           2
MinSpareThreads        5
MaxSpareThreads       10
MaxRequestsPerChild    0

Thursday, November 10, 2011

URL Rewriting - Examples



Apache Rewrite Rules can be used to transform a pretty ugly looking URL into a beautiful, SEO-friendly and meaningful URL. I would like to list a couple of real-world examples below to explain how Rewrite Rules can be set up and how they work. Rewrite Rules use Regular Expressions, so this article is closely related to my Regular Expressions article.

Tuesday, November 1, 2011

Load Balance Mysql Slaves Using MySQLProxy

I am sure you all have read about MySQL replication, like Master-Master, Single Master - Multiple Slaves and their topologies.
Here I am going to describe how you can load balance several MySQL Slaves and query logging.

Friday, August 12, 2011

Report Developer's About Error/Warning in Codes from Apache Logs

This is just a scenario i got it in mind, Reporting Warning/Error  to Developer(s), using a PERL script, this you can also be done using SHELL Script.

Tuesday, March 15, 2011

Monitor PostgreSQL with Queries

(Not All written by me.... )Some time just monitoring a DB servers from monitoring tools is just not enough, in that case we need some tool that let us know, what is DB is holding, processing, parameters etc..

Tuesday, February 22, 2011

Some Useful Quotes


Block Size:
The block size specifies size, that the file system, will use to Read and Write data. Larger block sizes will help improve disk I/O performance when using large files, such as Databases.
Mostly of size 1024, need to be 4096 for bigger file support like in database server case.

Block Size: Different Terms
1: Hardware Block Size = Sector Size
2: File System Block Size = Block Size
3: Kernel Buffer Block Size = Block Size
4: Partition Table Block Size = Cylinder Size
----------------------------------------------------------------------------------------------

MyISAM tables support concurrent inserts. If a MyISAM table has no holes in the middle resulting from deleted or updated records, inserts always take place at the end of the table and can be performed while other clients are reading the table. Concurrent inserts can take place even for a table that has been read-locked explicitly if the locking client acquired a READ LOCAL lock rather than a regular READ lock. If a table does have holes, concurrent inserts cannot be performed. However, you can remove the holes by using OPTIMIZE TABLE to defragment the table.
----------------------------------------------------------------------------------------------

Clustered Index: Clustered index physically rearrange the data that users inserts in your tables. It is nothing but a dictionary type data where actual data remains.
Non-Clustered Index: It Non-Clustered Index contains pointers to the data that is stored in the data page. It is a kind of index backside of the book where you see only the reference of a kind of data.
----------------------------------------------------------------------------------------------

To change the default size limit for MyISAM tables, set the myisam_data_pointer_size, which sets the number of bytes used for internal row pointers. The value is used to set the pointer size for new tables if you do not specify the MAX_ROWS option. The value of myisam_data_pointer_size can be from 2 to 7. A value of 4 permits tables up to 4GB; a value of 6 permits tables up to 256TB.

You can check the maximum data and index sizes by using this statement:

SHOW TABLE STATUS FROM db_name LIKE 'tbl_name';
----------------------------------------------------------------------------------------------

Both InnoDB and PostgreSQL - as well as many other databases - use a technique called multi-version concurrency control (MVCC) to provide transaction isolation: transactions should not see the work of other, uncommitted transactions.  MVCC means that, when a row is updated, the database stores both the old and new versions of the row.
----------------------------------------------------------------------------------------------

Tuesday, February 8, 2011

todays quote

Block Size:
The block size specifies size, that the file system, will use to Read and Write data. Larger block sizes will help improve disk I/O performance when using large files, such as Databases.
Mostly of size 1024, need to be 4096 for bigger file support like in database server case.

Block Size: Different Terms
1: Hardware Block Size = Sector Size
2: File System Block Size = Block Size
3: Kernel Buffer Block Size = Block Size
4: Partition Table Block Size = Cylinder Size
----------------------------------------------------------------------------------------------------------------------------------------------------
MyISAM tables support concurrent inserts. If a MyISAM table has no holes in the middle resulting from deleted or updated records, inserts always take place at the end of the table and can be performed while other clients are reading the table. Concurrent inserts can take place even for a table that has been read-locked explicitly if the locking client acquired a READ LOCAL lock rather than a regular READ lock. If a table does have holes, concurrent inserts cannot be performed. However, you can remove the holes by using OPTIMIZE TABLE to defragment the table.
----------------------------------------------------------------------------------------------------------------------------------------------------
Clustered Index: Clustered index physically rearrange the data that users inserts in your tables. It is nothing but a dictionary type data where actual data remains.
Non-Clustered Index: It Non-Clustered Index contains pointers to the data that is stored in the data page. It is a kind of index backside of the book where you see only the reference of a kind of data.
----------------------------------------------------------------------------------------------------------------------------------------------------

To change the default size limit for MyISAM tables, set the myisam_data_pointer_size, which sets the number of bytes used for internal row pointers. The value is used to set the pointer size for new tables if you do not specify the MAX_ROWS option. The value of myisam_data_pointer_size can be from 2 to 7. A value of 4 permits tables up to 4GB; a value of 6 permits tables up to 256TB.

You can check the maximum data and index sizes by using this statement:

SHOW TABLE STATUS FROM db_name LIKE 'tbl_name';
----------------------------------------------------------------------------------------------------------------------------------------------------

Both InnoDB and PostgreSQL - as well as many other databases - use a technique called multi-version concurrency control (MVCC) to provide transaction isolation: transactions should not see the work of other, uncommitted transactions.  MVCC means that, when a row is updated, the database stores both the old and new versions of the row.
----------------------------------------------------------------------------------------------------------------------------------------------------

Monday, January 24, 2011

Purge Bin_Logs, Save Disk Space - Mysql



Purge Bin_Logs Save Disk Space


Oftenly i meet with a question in mysql that, "How can I remove old mysql-bin log file in log directory?"

So here is the way... sort, good and practically proved.

Friday, January 21, 2011

Block Proxied IPs From Apache

Few days back i was fighting with a issue.. some one leached our website and showing my website contents on his domain.
Now my seniors start worrying about their product, and it was obvious.
I started digging out some methods.. and started playing with some settings.. like
some apache directives..