Showing entries 201 to 210 of 285
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: Development (reset)
Dog-pile Effect and How to Avoid it with Ruby on Rails memcache-client Patch

We were using memcache in our application for a long time and it helped a lot to reduce DB servers load on some huge queries. But there was a problem (sometimes called a “dog-pile effect”) - when some cached value was expired and we had a huge traffic, sometimes too many threads in our application were trying to calculate new value to cache it.

For example, if you have some simple but really bad query like

SELECT COUNT(*) FROM some_table WHERE some_flag = X

which could be really slow on a huge tables, and your cache expires, then ALL your clients calling a page with this counter will end up waiting for this counter to be updated. Sometimes there could be tens or even hundreds of such a queries running on your DB killing your server and breaking an entire application (number of …

[Read more]
Embedding a MySQL Server in C/C++ or Java applications

Last week at CeBit I once again had a conversation with an application developer that was not aware that it's possible to embed the MySQL Server inside an application instead of running it as a separate process. I experienced something similar at FOSDEM recently, while talking with the Amarok developers - how come that this feature is so little known? In fact, there are two possibilities for embedding MySQL (and both of them are licensed under the GPL): the first one is using the libmysqld embedded library, which is suitable if you are developing C/C++ applications:

The embedded MySQL server library makes it possible to run a full-featured MySQL server inside a client application. The main benefits are …

[Read more]
MySQL University tomorrow: Checking Memory with Valgrind by Stewart Smith

Since almost a year now, we host a weekly training session for our engineers on Thursday (14:00 UTC winter time), coined the "MySQL University". While it's primary purpose is to share and distribute knowledge about a wide variety of topics relevant to our own developers, many of the sessions are of general interest for developers on other projects as well.

Therefore we hold this sessions in the public and everybody is welcome to attend! You can listen to the presentation via an OGG Audio stream, questions can be posted via IRC on the #mysql-university channel on freenode.net. The audio file and IRC log will be saved, so you can also listen to past university sessions at a later point in time again.

[Read more]
Congratulations to the Drupal 6.0 release!

Yesterday, Drupal 6.0 was officially released - check out this screencast to get a 29-minute tour on the new features in this release.

We'd like to congratulate the Drupal Developer Team and Community for reaching this milestone and are happy that the MySQL Server continues to serve well as the database backend for this awesome content management platform!

I had the pleasure of evaluating and reviewing a previous release of Drupal for the Open Source Content Management System Award from Packt Publishing and it has been one of my favourites.

Keep up the good work!
 

FastSessions Rails Plugin Released

How often do we think about our http sessions implementation? I mean, do you know, how your currently used sessions-related code will behave when sessions number in your database will grow up to millions (or, even, hundreds of millions) of records? This is one of the things we do not think about. But if you’ll think about it, you’ll notice, that 99% of your session-related operations are read-only and 99% of your sessions writes are not needed. Almost all your sessions table records have the same information: session_id and serialized empty session in the data field.

Looking at this sessions-related situation we have created really simple (and, at the same time, really useful for large Rails projects) plugin, which replaces ActiveRecord-based session store and makes sessions much more effective. Below you can find some information about implementation details and decisions we’ve made in this plugin, but if you just want to try it, then …

[Read more]
Innodb Locks, ActiveRecord and acts_as_ferret Problem

Last few days one of our customers (one of the largest Ruby on Rails sites on the Net) was struggling to solve some really strange problem - once upon a time they were getting an error from ActiveRecord on their site:

1
(ActiveRecord::StatementInvalid) "Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE some_table.....

They have innodb_lock_wait_timeout set to 20 seconds. After a few hours of looking for strange transactions we were decided to create s script to dump SHOW INNODB STATUS and SHOW FULL PROCESSLIST commands output to a file every 10 seconds to catch one of those moments when this error occurred.

Today we’ve got next error and started digging in our logs…

After a couple of hours of looking in logs, parsing binary logs from MySQL …

[Read more]
Data Recovery Toolkit for InnoDB Released

I’m returned from my 1-week vacation today and want to say - I’ve never been so productive as I was there Blue ocean, hot sun and white sand really helped me to finish my work on the first release of one really awesome project.

Today I’m proud to announce our first public release of the Data Recovery Toolkit for InnoDB - set of tools for checking InnoDB tablespaces and recovering data from damaged tablespaces or from dropped/truncated InnoDB tables.

This release already has a pretty decent set of features:

  • Supports both REDUNDANT (pre mysql 5.0) and COMPACT (mysql 5.0+) versions of tablespaces
  • Works with single tablespaces and file-per-table tablespaces
  • Able to recover data even when processed InnoDB page has been reassigned …
[Read more]
French Characters Not Rendering Correctly

Background Knowledge

The MySQL database v4.0.23 is using the default character set of “Latin1″. When the database was created I had no knowledge of character sets other wise it would have been “UTF-8″.
The web pages are using a character set of “UTF-8″.

Problem

Data being queried from a MySQL database that contains French accent characters will not render correctly in the browser even after applying PHP htmlentities().

Example code: $string = htmlentities($string , ENT_QUOTES, “UTF-8″);

Solution

The queried data from the database was inputted using the character set “ISO-8859-1″. I …

[Read more]
HTML_QuickForm Generates Invalid Code for XHTML Strict

One of the biggest complaints I’ve had with HTML_QuickForm is not producing valid XHTML Strict code. Well there is a simple solution to removing the name attribute of the HTML form element tag using remoteAttribute().

Example
$form->removeAttribute(’name’);

ShareThis

Small Tip: How to Enable ActiveRecord Logging in Merb

Today I was developing one small merb application for one of our projects and needed to see ActiveRecord logging on console like I do in Rails. After a short research I’ve found out that merb_active_record plugin passes its MERB_LOGGER to AR by default so I decided to try to change merb log level and here they are - my pretty colored AR logs!

So, if you want to see ActiveRecord logs in your application in development mode, then you need to add one line to your conf/environments/development.rb file:

puts "Loaded DEVELOPMENT Environment..."

MERB_LOGGER.level = Merb::Logger::DEBUG

That’s it for now. Long live merb!

Showing entries 201 to 210 of 285
« 10 Newer Entries | 10 Older Entries »