MySQL Server Crashing need Help

Hi, we have some problem with mysql high cpu , would like some help with MySQL Tuning
here are the mysqltuner & tuning-primer details
mysqltuner:

[root@main src]# mysqltuner

 >> MySQLTuner 1.1.1 - Major Hayden <major@mhtx.net>
 >> Run with '--help' for additional options and output filtering

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.56-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 275M (Tables: 654)
[--] Data in InnoDB tables: 35M (Tables: 293)
[!!] Total fragmented tables: 300

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 10h 19m 57s (631K q [16.981 qps], 39K conn, TX: 3B, RX: 102M)
[--] Reads / Writes: 97% / 3%
[--] Total buffers: 906.0M global + 4.6M per thread (500 max threads)
[OK] Maximum possible memory usage: 3.1G (26% of installed RAM)
[OK] Slow queries: 0% (106/631K)
[OK] Highest usage of available connections: 2% (14/500)
[OK] Key buffer size / total MyISAM indexes: 8.0M/59.4M
[OK] Key buffer hit rate: 100.0% (12B cached / 317K reads)
[OK] Query cache efficiency: 68.4% (350K cached / 511K selects)
[!!] Query cache prunes per day: 166830
[OK] Sorts requiring temporary tables: 0% (10 temp sorts / 171K sorts)
[!!] Temporary tables created on disk: 48% (26K on disk / 54K total)
[OK] Thread cache hit rate: 99% (102 created / 39K connections)
[!!] Table cache hit rate: 9% (1K open / 10K opened)
[OK] Open file limit used: 17% (1K/8K)
[OK] Table locks acquired immediately: 99% (206K immediate / 206K locks)
[!!] Connections aborted: 28%
[OK] InnoDB data size / buffer pool: 35.4M/512.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
 Run OPTIMIZE TABLE to defragment tables for better performance
 MySQL started within last 24 hours - recommendations may be inaccurate
 Temporary table size is already large - reduce result set size
 Reduce your SELECT DISTINCT queries without LIMIT clauses
 Increase table_cache gradually to avoid file descriptor limits
 Your applications are not closing MySQL connections properly
Variables to adjust:
 query_cache_size (> 128M)
 table_cache (> 2048)

tuning-primer

/etc/my.cnf

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
query_cache_size = 512M
join_buffer_size = 2M
thread_cache_size = 4
table_cache = 4096
table_definition_cache = 1024
query_cache_limit = 20M
#skip-bdb
long_query_time = 10
log-slow-queries = /var/log/mysql-slow.log
tmpdir = /var/lib/mysql/tmp
max_connections = 500
max_user_connections = 10
tmp_table_size = 256M
max_heap_table_size = 256M
innodb_buffer_pool_size = 512M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
key_buffer = 16M
myisam_sort_buffer_size = 32M
read_buffer_size = 2M
sort_buffer_size = 2M
interactive_timeout = 25
wait_timeout = 1000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_type = 1
skip-innodb
[mysqld_safe]
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 32M
sort_buffer = 32M
read_buffer = 16M
write_buffer = 16M
[mysqlhotcopy]
interactive-timeout A

Thank you.

It is difficult to pinpoint the problem without knowing much about your setup. What exactly do you mean by a crash? Is it hardware related because of mysql or does only mysql crash? Did you run top prior to a crash? Is the crash repeatable?
I also noticed the following: Temporary table size is already large - reduce result set size.
Just want to make sure that you are not writing temporary tables into a user file system where they do not belong?