If you have a large MySQL database with high traffic and too many queries are loading the best thing to do is enable “mysql query caching”.
In order to enable the MySQL query cache, you will need to set some variables in mysql configuration file which in most cases is called my.cnf but not all server have it enabled so you will have to either create a new one or copy existing .cnf files.
Usually located under any of these directories:
/etc/my.cnf
/etc/mysql/my.cnf
$MYSQL_HOME/my.cnf
[datadir]/my.cnf
~/.my.cnf
If you can’t find it there then move try running a shell command locate my.cnf and what this does is look for that file so your can find the location and edit it but if it does not return any results you can try and see if any of the following files exist:
my-medium.cnf
my-small.cnf
my-large.cnf
Most likely one of them will return so just copy the my-medium.cnf(for normal or medium size databases) file to the /etc/ directory and rename it to my.cnf
Now open up your newly created my.cnf file (command vim my.cnf )
That will open up the following file but **note that this is on a localhost so the configuration file might be different on your server.
Sample MySQL config file for medium systems.
#
# This is for a system with little memory (32M – 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /Applications/MAMP/db/mysql) or
# ~/.my.cnf to set user-specific options.
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the “–help” option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /Applications/MAMP/tmp/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /Applications/MAMP/tmp/mysql/mysql.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#added for query cache (added)
query-cache-type = 1(added)
query-cache-size = 10M(added)
# Don’t listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the “enable-named-pipe” option) will render mysqld useless!
“/Applications/MAMP/Library/my.cnf” 158L, 5018C
Now you will need to enable the query_cache by just adding these two lines of code :
query-cache-type = 1
query-cache-size = 10M
or if that does not work try this :
SELECT SQL_CACHE field1, field2 FROM table1 WHERE field3 = ‘yes’
And to check see if your mysql server has enabled query cache, simply run this query:
SHOW STATUS LIKE ‘%qcache%’;
a result similar to this will show up:
+————————-+———-+
| Variable_name | Value |
+————————-+———-+
| Qcache_queries_in_cache | 1 |
| Qcache_inserts | 3 |
| Qcache_hits | 0 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 2 |
| Qcache_free_memory | 20947592 |
| Qcache_free_blocks | 1 |
| Qcache_total_blocks | 4 |
+————————-+———-+
And you can adjust the settings as you see go along. Thats it!
If you have any questions or like us to set this up for you please
contact us
Solved:Enabling sendmail on localhost for MAMP free version
/in Website Tips/by donEnabling the sendmail function on localhost to send and receive emails has turned out to be a project so I decided to figure out the solution and share it with everyone else.
In free version MAMP mail function is not enabled by default and you have to enable it yourself. At, first when I tried out MAMP on my localhost I found out about this when one of the application was not sending out the mail. So, I did some research but was not able to find much of anything however after digging and info gathering around the web and forums I finally found the solution.
Note that MAMP forums suggest to enable Postfix but for some odd reason I wasn’t able to get Postfix working with my domain’s email settings which is on gmail(google apps).
Solution:
First thing you have to do is locate php.ini which is located below:
Next, you will need to open up your php.ini file and find “[mail function]” you should do the following:
Existing MAMP default configuration:
I’m not really sure why MAMP’s default [mail function] settings have the Win32 options enabled and the unix path not turned on:
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
;sendmail_path =
Change it to this: (you can copy and paste the following code)
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
; For Win32 only.
;sendmail_from = don@tripleroi.com
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
sendmail_path =/usr/sbin/sendmail -t -i -f yourname@example.com
Make sure you change your email from yourname@example.com to your own email.
The “sendmail_path =/usr/sbin/sendmail -t -i -f yourname@example.com” I found this in a forum thread, but figured I would put a little bit more detail into what I discovered so that its easy for people to understand. I’ve done this testing all in my localhost development it has been very helpful e-mailing me when I test out new applications. This worked for but its not guaranteed that it can work for anyone as it depends on your MAMP and OS version, Hope this helps.
Did your WordPress website get hacked ?
/in Hacked, Security, wordpress boston/by donMost common hacking problems:
And the list goes on and on as hackers always find loopholes to dig in. The funny thing is that these hackers do it for the fun of the game not to really do any harm but its embarrassing to a business when a customer goes to the homepage to find a hackers message.
So what to do if your WordPress is hacked ?
First, this to do is change all of your passwords including server and FTP not only your WordPress. Second, take your site down and put a simple html “under maintaince” page so people dont see the hacked message. Third, go to your backups(assuming you have backups) and restore everything back to normal starting with WP files as well as database files. If this fails then you have to ask for professional programmer or WordPress expert to fix the issue.
Installing WordPress is one thing but keeping it safe its a whole different animal and appropriate security patches need to be added for future prevention. Hope this helps and if you need any help with WordPress let us know!
WordPress Shared Hosting is a Big NO
/in local wordpress developer, wordpress boston, wordpress designer Boston/by donStay away from shared servers
Keep in mind that going for a shared hosting is not a great idea unless your resources are very limited. In a shared hosting environment you are sharing your resources with many other sites. For example: IP address, RAM, Bandwidth etc. What this does is limit your sites ability to perform as it should as the other websites’s scripts maybe running hight and using up a good percentage of that memory. This is where WordPress runs into issues as its being limited use the memory it needs. We’ve seen large WordPress sites take up as much as 256MB.
Also, if you are sharing IP address across 100 other sites the chances are high that one of this domains is spamming search engines and they may block that IP that you are sharing.
Conclusion, from experience we’ve seen WordPress websites perform a lot better when hosted to a private server with a dedicated IP. However, owning a virtual private server comes with its difficulties as you will most likely need some technical knowledge to set it up and maintain it.
Internet Continues To Weave
/in Online Marketing, Strategic Planning Process/by doneCommerce Strategy – Why aren’t Customers Buying Online?
/in Ecommerce, Online Shop, Shopping Cart/by donWe often hear people say:
“I have so many customers that visit my website but how do I get them to buy my products online”
“I look at my analytics and see that they abandon my shopping cart within seconds”
“Why aren’t my my products selling online, how can I increase my online sales ?”
You have done everything right and even get some decent traffic to your website through SEO or pay per click advertising but still people are not buying from you – so what’s the problem?
Well, all that is great but you have to put yourself in customers shoes and think how do they make the ultimate purchase decision.
Quick Tips
First, look at your product page and see if there are any barriers such as add to cart button. Is it properly placed where customers can see it ? Is it the right color ? Is it the right width/height?
How many steps are in your checkout process ?
There are some many aspects to look and every merchant as different needs so it on a case by case basis.
Getting people to buy online is more than just having an online shop – a well crafted strategy is needed. Its not just cool graphics and beautiful photos because everyone has all of those, it more about the psychological aspects of ecommerce. Selling online is very competitive and for a business to succeed it needs to have a well calculated business model and strategy.
Let us know if we can help you
Know Your Target Audience
/in freelance web designer boston, UI Design, User Interface Design/by donI can instantly look at a UI and find at least 10 things wrong with it wether its a back-end or front-end. The solution is to take a second look and learn more about the people are actually going to use it and design it based on those aspects. As simple as that. Know your audience!
Solved: WARNING: The locate database (/var/db/locate.database) does not exist
/in tips/by donWARNING: The locate database (/var/db/locate.database) does not exist.
After some investigation I finally figured it out that the database had to be rebuild again so a simple command line did the trick.
Open your terminal.app the type copy and paste this line of code :
/usr/libexec/locate.updatedb
This command will succefully update and rebuild your DB. Note that this might take a awhile so be patient and if you get an error like this after its finished just ignore as it will still work.
/usr/libexec/locate.updatedb: line 97: /var/db/locate.database: Permission denied
Happy locating!!!
Speed Up Website By Enabling MySQL query_cache
/in mysql, slow performance, speed up/by donIf you have a large MySQL database with high traffic and too many queries are loading the best thing to do is enable “mysql query caching”.
In order to enable the MySQL query cache, you will need to set some variables in mysql configuration file which in most cases is called my.cnf but not all server have it enabled so you will have to either create a new one or copy existing .cnf files.
Usually located under any of these directories:
/etc/my.cnf
/etc/mysql/my.cnf
$MYSQL_HOME/my.cnf
[datadir]/my.cnf
~/.my.cnf
If you can’t find it there then move try running a shell command locate my.cnf and what this does is look for that file so your can find the location and edit it but if it does not return any results you can try and see if any of the following files exist:
my-medium.cnf
my-small.cnf
my-large.cnf
Most likely one of them will return so just copy the my-medium.cnf(for normal or medium size databases) file to the /etc/ directory and rename it to my.cnf
Now open up your newly created my.cnf file (command vim my.cnf )
That will open up the following file but **note that this is on a localhost so the configuration file might be different on your server.
Sample MySQL config file for medium systems.
#
# This is for a system with little memory (32M – 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /Applications/MAMP/db/mysql) or
# ~/.my.cnf to set user-specific options.
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the “–help” option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /Applications/MAMP/tmp/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /Applications/MAMP/tmp/mysql/mysql.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#added for query cache (added)
query-cache-type = 1(added)
query-cache-size = 10M(added)
# Don’t listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the “enable-named-pipe” option) will render mysqld useless!
“/Applications/MAMP/Library/my.cnf” 158L, 5018C
Now you will need to enable the query_cache by just adding these two lines of code :
a result similar to this will show up:
| Variable_name | Value |
+————————-+———-+
| Qcache_queries_in_cache | 1 |
| Qcache_inserts | 3 |
| Qcache_hits | 0 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 2 |
| Qcache_free_memory | 20947592 |
| Qcache_free_blocks | 1 |
| Qcache_total_blocks | 4 |
+————————-+———-+
New! Google Analytics Premium Service
/in Analytics, Google/by donGoogle Analytics Premium Introduction Video
Pricing
Annual plan comes at $150,000, according to Forrester analyst Joseph Stanhope.
“Is the transformation complete? It is not; at this early stage GA Premium is not a substitute for an established enterprise implementation in many cases,” Stanhope wrote in a blog post. “But it’s a huge step forward for a solid offering, and Google will continue to aggressively iterate the product to close the remaining gaps over time.”
This new premium service looks like its a great tool for large companies who are looking to expand their analytics knowledge with more than just clicks or page views but with real time data and in depth site analytics.
To learn more about it visit http://www.google.com/analytics/premium/
Working For You and Your Customer
/in boston web designer/by donIn addition designers must reconcile their own standards of aesthetics, quality and ethics with the requirements of the intended commercial purpose of their work. Both designer and client should also consider community values and constraints.