You are viewing [info]capttofu's journal

Patrick Galbraith's Journal
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 20 most recent journal entries recorded in Patrick Galbraith's LiveJournal:

    [ << Previous 20 ]
    Thursday, February 24th, 2011
    4:26 pm
    Things I didn't know you could do with top...
    My colleague Mike Hamrick, who I'm very fortunate to work with, made a presentation on some cool things you can do with top: http://tinyurl.com/48pmu83. These are some great tips that every MySQL DBA or developer should watch!
    Wednesday, February 9th, 2011
    2:49 pm
    Memcached Functions for MySQL 1.1 Released!
    I just released Memcached Functions for MySQL, version 1.1. I'm very happy with this release since it has a new get_cas() and get_cas_by_key() function as well as my own shiny new string functions! See Blue Gecko's blog for details: http://www.bluegecko.net/mysql/memcached-functions-for-mysql-1-1-released/
    Wednesday, September 8th, 2010
    9:03 pm
    I love my new job!
    I just have to chime in about how happy I am with my new job. I now work for Blue Gecko, as of August 30th. My role is a Senior Database and Systems Administrator. Blue Gecko is based out of Seattle though I'll be working out of my home in New Hampshire, albeit with my frequent travels to Seattle for family reasons, this will work out quite well.

    Already in the last week, I've engaged in several tasks, all of which have been very interesting problems to solve. Not only that, but I've spoken with several existing and potential customers and never realized I really enjoy consulting with and acquiring customers-- hearing what problems they need to solve and being able to ascertain quickly how to solve those problems, making the customer look forward to engaging with us.

    Who is Blue Gecko?

    Based out of Seattle, their website states (http://www.bluegecko.net/)

    "We don't eat, sleep, or go on vacation. We live for three things:

    * Smooth, uninterrupted database operation for your company
    * Proactive monitoring for potential problems
    * Rapid, expert response with no restrictions or delays

    "

    We are a remote DBA (Database Administrative) service. We provide a service that would require an organization to have to hire a bunch of DBAs and even sysadmins. We provide this for Oracle, MySQL, and recently PostgreSQL and SQL Server.

    Just from my first week here, there are some top-notch people that I'm already enjoying working with.

    Some of the tasks I've worked on:

    * Restoring data that a developer accidentally truncated from tables using InnoDB Tools (http://code.google.com/p/innodb-tools/). I hadn't done this before, and it was fantastic to be able to restore that data in such a dire situation

    * Optimizing a query and ultimately how the data is stored in a table for a query that used a file sort that would be extremely slow unless you forced use of the index that the order by was using. The teaser was that EXPLAIN would show a full-table scan if the force index was used. This was a good exercise in understanding the buffer pool as well as how InnoDB works with indexes.

    * Crawling through a schema with a bunch of tables and finding many optimizations

    * Discussing deployment of The Sphinx Search Engine for a client who needs search functionality

    * Various Perl questions from one of my Co-workers. I was able to send the code that I wrote for my book to help them solve a problem. I felt great being able to help someone so soon after starting a new job

    The thing that has really dawned on me is that I prefer working on components within the LAMP stack, especially MySQL, with an eye on where NoSQL fits in as well.

    I just wanted to write about my realization that I've had over the last several days!

    Current Mood: happy
    Tuesday, September 7th, 2010
    10:49 am
    Cloud systems vs. NoSQL email with tons of questions
    I had an email after my webinar on NoSQL/SQL for Oracle Development Tools User Group last week (http://www.odtug.com/apex/f?p=500:1:0) from an attendee that was chock full of some questions. I decided to answer them to clarify with this fellow NoSQL and Cloud Systems. I'm pretty happy with my answers. I'd be glad for any thoughts from people about my replies.

    Here are my responses (the fellow's name is also Patrick):

    Patrick,

    You are welcome! Thank you for attending. I put that together a bit hasty but thought it was a good topic to be covering as there are so many organizations that are considering such an architecture.

    Patrick Francois wrote:
    > Hi,
    >
    > Thank you for the NoSQL Webinar!
    > Not an easy theme. ..kind of "wide open".
    > I have recently also tried getting more info on NoSQL and related systems and performance issues. ...and get confused, especially also with the "cloud systems".

    Yeah, a lot of buzzword-BS and reinventing the wheel going on. They key to remember is that SQL is not going to be replace SQL any time soon, but the combination of SQL and NoSQL can have its advantages.

    >
    > I checked for example this document regarding benchmarking "cloud systems":
    > (maybe you know that document as well)
    > -> "BenchmarkingCloudServingSystemswithYCSB"
    > (YCSB -> Yahoo!CloudServingBenchmark)
    > -> straight link: http://www.brianfrankcooper.net/pubs/ycsb.pdf
    >
    > There they speak about : explosion of new systems for datastorage and management "in the cloud"
    > They mention there all these different NoSQL storage systems,
    > and say for example also: Some systems are offered only as cloud services, either directly in the case of Amazon SimpleDB[1]


    Yeah, SimpleDB being Amazon's S3, a proprietary system. You can download it and run it on your own cluster or private cloud.


    > ....
    >
    > That's why I'm also a bit confused about "cloud systems" and "NoSQL".

    Cloud systems - usually virtual machines that can be easy spun up for elasticity - I want to add more servers to my virtual network on the fly. This can be via either your own VMWare Labmanager setup or something like EC2. There are also real hardware clouds using services such as what Rackspace offers.

    By "cloud systems" and "NoSQL", it just means running these databases in an environment such as EC2, VMware, or Rackspace, etc... For instance, you can have relational databases in the cloud such as with MySQL, Drizzle, or etc...

    You can also run them NoSQL databases on your own systems. NoSQL and Cloud systems are not mutually exclusive of each other.

    > Basically if you speak about cloud systems, you also speak about scaling out same as you are speaking about "scaling out" when speaking about NoSQL.


    Scaling out can be in the cloud as well as outside the cloud. It just means running applications and databases over a several systems versus using an every increasing big huge server and growing that server to scale as was done in the Good Old Days (TM).


    >
    > So, does it imply that NoSQL systems are cloud systems?

    No, they can be, but are not. NoSQL means a database system that doesn't use SQL to access data, non-relational

    > How would you see the relation "NoSQL" / "Cloud systems".


    They complement each other. NoSQL works well in a cloud paradigm.


    >
    > --
    > Even "cloud system" meaning as such is rather unclear.
    > There was the question about "Cassandra server farm":
    > If I create an own cassandra server farm, can I then still speak about a "cloud system", or can I speak about a "cloud system" only when underlying servers are also geographically distrubuted?

    Geographical distribution isn't the determinant in the definition of cloud system. I could have a cloud system down in my cellar if I wanted to if I have multiple real or virtual servers.

    >
    > There is also the "security" issue when it comes to "cloud systems" and some say security is bigger because data is distributed. I understand that in that way, you cannot really get hand (or get hacked) on all the data at once, eventually just a part of the data.
    > But if I think on an own Cassandra farm, where eventually all machines are in the same machine room and network, I can imagine if you can get into one machine, you can get into all of them.

    This issue requires you to do some homework about how to secure your servers. Set up a good image with everything locked down and use something like puppet to have it come up with all the goodies you set up in that image. Define a list of must-haves before that box (virtual or real) is on the network.

    >
    > From the YCSB-document "some systems are offered only as cloud services",
    > I understand that for using Amazon's SimpleDB, you could not create your own server farm, rather need to buy that service from Amazon?


    Yeah, you're not going to run your own S3. You can run other NoSQL or distrubuted file systems - pick your choice with a Google Search.


    >
    > That is causing me confusion between "NoSQL" and "Cloud systems".


    NoSQL - as I defined in the presentation - schema less, often non-relational, doesn't use SQL as the Linga Franca of data access.

    Cloud systems - multiple boxes, real or virtual, elastic, as I mention above.

    Two different but mutually complementary concepts.


    > --
    > Memcached and Membased sounded very interesting. I will check more on those.


    Please do. And do join the mailing lists. I see Matt Ingenthron and Perry Krug answering emails every day!


    > --
    > Can you eventually also provide the slides you used?


    Certainly - let me make sure they care clean and I'll send them to you!

    Current Mood: cheerful
    Monday, August 16th, 2010
    12:02 pm
    Getting Ruby and Rake versions sorted out

    I've been working on updating the various libmemcached wrapper drivers to the latest libmemcached and was having an issue trying to build the Ruby libmemcached client, Fauna (developed by Evan Weaver) due to my Ubuntu box originally having Ruby 1.8 installed but gem would install modules that are needed for Fauna - echoe and mocha - into the 1.9 library directory. I found this useful post here: http://michalf.me/blog:make-ruby-1-9-default-on-ubuntu-9-10-karmic-koala which I modified and this here is the script I ended up using that will allow Fauna to build:

    #!/bin/sh
    
    aptitude -y install ruby1.9.1 ruby1.9.1-dev \
            libopenssl-ruby1.9.1 rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 g++
    
    # If you already have 1.8 installed
    update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 500 \
            --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
                /usr/share/man/man1/ruby.1.8.gz \
            --slave   /usr/bin/ri ri /usr/bin/ri1.8 \
            --slave   /usr/bin/irb irb /usr/bin/irb1.8 \
            --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.8
    
    # Install ruby1.9.1
    update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
             --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
                                       /usr/share/man/man1/ruby1.9.1.1.gz \
            --slave   /usr/bin/ri ri /usr/bin/ri1.9.1 \
             --slave   /usr/bin/irb irb /usr/bin/irb1.9.1 \
            --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1
    
    # choose your interpreter
    # changes symlinks for /usr/bin/ruby ,
    # /usr/bin/irb, /usr/bin/ri and man (1) ruby
    update-alternatives --config ruby
    update-alternatives --config gem
    
    gem update
    gem install echoe
    gem install mocha
    


    And if you now run:

    patg@patg-desktop:~/code_dev/ruby-memcached$ ruby --version
    ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
    patg@patg-desktop:~/code_dev/ruby-memcached$ gem --version
    1.3.5
    patg@patg-desktop:~/code_dev/ruby-memcached$ rake --version
    rake, version 0.8.7
    
    
    Monday, July 26th, 2010
    9:06 pm
    Ubuntu apt-get install failure fix
    This post is to add to a search anyone trying to figure out how to fix "apt-get install" failing. This was Ubuntu 9.10, attempting to install php-pear:
    apt-get install php-pear

    The error was:
    E: Internal Error, Could not perform immediate configuration (2) on mountall

    What I did was:
    cd /var/cache/apt/archives/
    dpkg -i --force-depends *
    

    Then after a bunch of output:
    apt-get -f install

    That did the trick! Hope this helps if you stumble upon this issue.
    Monday, July 19th, 2010
    2:19 pm
    new release of Perl libmemcached drivers
    I'm pleased to announce the release of Cache::Memcached::libmemcached 0.02011 and Memcached::libmemcached 0.4201. Cache::Memcached::libmemcached uses Memcached::libmemcached, which is a Perl wrapper for libmemcached, which is now in sync with the latest libmemcached, 0.42. This means support of binary protocol as well as other current libmemcached features. I've uploaded both to CPAN, so once the mirrors update they will be available via CPAN.

    Changes in this release:

    Changes in 0.4201 (svn r163) 15th July 2010

      Sync with libmemcached 0.42
      Squashed various compile warnings
      Many updates to libmemcached API calls due to API changes
      Merged existing svn tree (which was out of sync) with Daisuke Maki's official tree

    Current Mood: cheerful
    Thursday, July 15th, 2010
    1:29 pm
    As of late...
    What I'm up to lately (giving love to some projects):

    * Fixing bugs in DBD::mysql, just released 4.015, 4.016, and next 4.017. I had a patch sent yesterday from a user/developer that I want to get out there
    * Memcached::libmemcached - 0.4201 version - now using latest libmemcached 0.42. This is the only Perl client that supports binary protocol!

    patg@patg-desktop:~/code_dev/perl-libmemcached$ PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/12-set-get-binary.t
    t/12-set-get-binary....ok                                                   
    All tests successful.
    Files=1, Tests=5,  0 wallclock secs ( 0.04 cusr +  0.01 csys =  0.05 CPU)

    Whoot!

    * FederatedX (in Maria) - fixing MySQL bug 32426, https://bugs.launchpad.net/maria/+bug/571200 . This involves a little work as it is fixed in Federated (not FederatedX) and FederatedX has a whole new design using an IO class to abstract database driver details as well as numerous other changes. But it will happen.

    * Delving into C++ Boost libraries. These look quite useful!

    Current Mood: happy
    Saturday, July 10th, 2010
    12:01 am
    DBD::mysql 4.015 Released
    I'm glad to let everyone out in Perl Land know that DBD::mysql 4.015 is released. Per the changelog:

    * BUG #56664 fixed t/40blobs.t skip_all logic (W. Phillip Moore)
    * BUG #57253 Fixed iteration past end of string (crash). (Chris Butler)
    * Added a new parameter for old behavior- mysql_bind_comment_placeholders which
      will make it possible to have placeholders bound within comments for those who really
      want that behavior.
    * Fixed bind_type_guessing - always on now. Numbers will not be automatically quoted as they are now.

    You can get the latest release at:

    http://search.cpan.org/~capttofu/DBD-mysql-4.015/

     file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.015.tar.gz
     size: 132029 bytes
      md5: 4d80bb5000b97bbfbe156140b9560c20

    Also, the latest source:

    git://github.com/CaptTofu/DBD-mysql.git

    Thanks for using DBD::mysql and reporting bugs!

    --Patrick 'CaptTofu' Galbraith

    Current Mood: tired
    Sunday, April 18th, 2010
    9:08 am
    Cleaning up OS X /core directory - path to disk liberation!
    Today, I discovered where all my disk space is going. I use a Macintosh and pretty much live in either my home directory or /usr/local or /opt/local. I kept running out of space and having to move things around, 'make clean', get an external hard drive, etc. I happened to stumble upon a directory /cores:

    patrick-galbraiths-macbook-pro:/ patg$ du -s cores/
    79295824    cores/

    Ikes!

    Filesystem    1024-blocks      Used Available Capacity  Mounted on
    /dev/disk0s2    118153176 112094368   5802808    96%    /
    devfs                 107       107         0   100%    /dev
    fdesc                   1         1         0   100%    /dev
    map -hosts              0         0         0   100%    /net
    map auto_home           0         0         0   100%    /home

    patrick-galbraiths-macbook-pro:cores patg$ sudo rm -f cores/*

    patrick-galbraiths-macbook-pro:/ patg$ df -k
    Filesystem    1024-blocks     Used Available Capacity  Mounted on
    /dev/disk0s2    118153176 71190080  46707096    61%    /
    devfs                 107      107         0   100%    /dev
    fdesc                   1        1         0   100%    /dev
    map -hosts              0        0         0   100%    /net
    map auto_home           0        0         0   100%    /home


    Wow! I freed up 40GB! 

    This is like Christmas!

    And yes, I know, I should see why the heck I have so many core dumps going on, but for now, I'll rejoice in having some disk space!

    I'm sure many of you who stumble upon this may already know this, but for those of you who don't, I hope the tip helps!

    Current Mood: cheerful
    Thursday, April 15th, 2010
    12:09 pm
    DBD::mysql 4.014 Released
    It's been an extremely busy year thus far with all the great work we're doing at NorthScale as well as the release of CaptTofu 2.0 (My son Kiran!). With the new UI on rt.cpan.org, in my spare time, I went through and closed some bugs, hence a new release of DBD::mysql, 4.014. In this release:

    * BUG 30033 Fixed handling of comments to allow comments that contain characters
      that might otherwise cause placeholder detection to not work properly
    * BUG 53844, Fix for memory leak in stats. (Gregory Burmistrov)
    * BUG 49719, Fix for handling of NULLs in prepared statements (Gert Pache)
    * BUG 55627, Fix for testing failure due to strict mode (Yves)
    * BUG 51784, Fix for mysqladmin on Windows in Makefile (Zeeshan Muhammad)
    * BUG 41630, Typo in Makefile

    There are other bugs in rt.cpan.org, hence a pending release in the next week or two. I like an empty bug list!
    Thank you to Gregory Burmistrov, Gert Pache, Yves, Zeeshan Muhammad for your patches!

    You can find the code at:

    http://search.cpan.org/~capttofu/DBD-mysql-4.014/

    The file:

      file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.014.tar.gz
      size: 131270 bytes
       md5: 74f118a4984e6a49f8ece28e68caf543


    Also, I have moved the source repository from Subversion to Git (Github)

    git clone git://github.com/CaptTofu/DBD-mysql.git

    Why Github? I've really grown to like Git once my brain wrapped around it. No slight to any other system. I have DBD::drizzle hosted at Launchpad. At least now, I have to only concentrate on remembering how to use two revision control systems!

    Current Mood: awake
    Wednesday, April 14th, 2010
    4:56 pm
    Expert PHP and MySQL published!
    Expert PHP and MySQLI'm very pleased to announce the publication of my book Expert PHP and MySQL, published by Wrox. This book was written by myself, Andrew Curioso and Ronald Bradford. The short of it is, upon finishing my previous book, Developing Web Applications with Apache, MySQL, memcached, and Perl, Wiley asked me if I knew of anyone who would like to write a MySQL/PHP book. I had worked with Andrew at Lycos and found him to be a brilliant PHP developer, having been the primary developer of Lycos's Webon product-- which has some excellent usage of PHP, Javascript and MySQL. When I friend of mine Bob Wilkins, who started MyVBO, was looking for a developer I suggested Andrew (he now works at MyVBO), and for this book I also suggested Andrew. Andrew had also written a short book for O'Reilly on AJAX, so Wiley was glad to have had him as a suggestion. They came back and asked if I would lend a hand to which despite being exhausted from writing my first book, decided to contribute and work on some chapters that covered material that thought would be a great benefit to the community-- namely Gearman, Sphinx, the Memcached Functions for MySQL as well as Memcached itself. Finally, we needed someone else with MySQL expertise to add to the mix to cover more advanced MySQL information to which Ronald Bradford, who I know, like, and respect as an expert in the field, signed on also.

    For me, I have been more of a Perl guy, however, I like PHP just as well and even prefer how it's web deployment model is much easier (you don't need to modify your httpd config files) was interested in a challenge of writing a book on a different language. Also, some fruits of this being that my project from my Perl book, Narada, now has a PHP port.

    I'm proud of this book. It was harder in some ways to write a book with other people than do it all myself, despite far fewer pages. However, the end product took advantage of all our strengths.

    Topics covered in this book are (but not limited to!):

    * PHP and MySQL techniques every programmer should know
    * Advanced PHP concepts such as using iterators, making classes behave like functions, using true lambda functions and closures
    * MySQL storage engines
    * Using the information schema
    * Improving performance through caching - using memcached to add a caching layer to your application
    * Writing UDFs
    * Writing PHP extensions
    * Using the Memcached Functions for MySQL (UDFs)
    * Full text search - installing, configuring, and using Sphinx in a PHP application
    * Multi-tasking in PHP using Gearman. Narada is used as an example application demonstrating how to put many of the concepts of the book into an application
    * Using Apache rewrite rules
    * HTTP-based authentication

    All-in-all, this is a great book that I hope will benefit PHP/MySQL or any other web developers who need a source of expert information!

    I want to thank Andrew, Ronald, Wiley (Bob Elliot, Maureen Spears), Trond Norbye and Eric Day (who tech-edited the book!), and all others who I could write a book in itself who have helped (see my credits in the book!). Also, I want to thank the team at NorthScale, my employer, for being able to work with a team experts who I could refer to while working on this book.

    You can buy this book from any major publisher, and from Wiley at http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470563125.html


    Current Mood: chipper
    Monday, December 28th, 2009
    8:26 pm
    Memcached 1.4.4 for Windows 64-bit!
    I decided to get my compilation package of memcached 1.4.4 running on win64 available:

    http://blog.northscale.com/northscale-blog/2009/12/memcached-windows-64bit-prerelease-available.html

    Current Mood: chipper
    Friday, December 11th, 2009
    12:02 pm
    bazaar is really annoying me
    Ok, I have to get this off my chest. As much as I feel clueless with Git at times, Bazaar is really a PITA! Launchpad upgrades something, then my bazaar repositories are broken. This is not acceptable as a revision control tool. Then I ask people and they say "you have to upgrade bazaar". Ok, so I'm trying to do that:

    patg@hanuman:~/code_devel$ bzr clone lp:bzr
    Enter passphrase for key '/home/patg/.ssh/id_dsa': |
    bzr: ERROR: exceptions.KeyError: 'Bazaar repository format 2a (needs bzr 1.16 or later)\n'

    Traceback (most recent call last):
    File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 729, in exception_to_return_code
    return the_callable(*args, **kwargs)
    File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 924, in run_bzr
    ret = run(*run_argv)
    File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 560, in run_argv_aliases
    return self.run(**all_cmd_args)
    File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1143, in run
    source_branch=br_from)
    File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 1142, in sprout
    cloning_format = self.cloning_metadir(stacked)
    File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 176, in cloning_metadir
    repo_name)
    File "/usr/lib/python2.5/site-packages/bzrlib/registry.py", line 260, in get
    r = Registry.get(self, format_string)
    File "/usr/lib/python2.5/site-packages/bzrlib/registry.py", line 173, in get
    return self._dict[self._get_key_or_default(key)].get_obj()
    KeyError: 'Bazaar repository format 2a (needs bzr 1.16 or later)\n'

    bzr 1.15 on python 2.5.2 (linux2)
    arguments: ['/usr/bin/bzr', 'clone', 'lp:bzr']
    encoding: 'ANSI_X3.4-1968', fsenc: 'ANSI_X3.4-1968', lang: None
    plugins:
    bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.15]
    fastimport /home/patg/.bazaar/plugins/fastimport [0.8dev]
    launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [1.15]
    netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [1.15]
    *** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

    Yeah, ok. That works great.

    How about this: How about they write a revision control tool that doesn't break repositories because they upgrade the @#$#%ed website?

    Also, on my Mac, I can't upgrade Bazaar because the latest version is only for Snow Leopard. So, launchpad is upgraded, and people are scrambling to "fix" their Bazaar setup so they can develop their code.

    I've just wasted hours trying to get this all to work. Revision control tools are meant to make people productive, not eat of their time "fixing" things.

    Current Mood: aggravated
    Wednesday, December 9th, 2009
    11:03 pm
    libmemcached on Windows working!
    I am so thrilled! I have libmemcached running on Windows! I've had to hack a bit with the Makefile (which is generated) and disabled some things like the 'example' directory as well as some code that's using sys/mman.h, which mingw32 does not have.

    This image show the compile is successful:

    http://img.skitch.com/20091210-pmnjdxudgf39hqc9jwy1ktf4y6.jpg

    I was able to run memslap (strange results, but it seems to be setting values)

    Administrator@IP-0AF859ED /c/code-dev/bak/libmemcached-win32-bzr
    $ ./clients/memslap.exe --servers="localhost:22122" --concurrency=1 --binary

    Then to verify:

    $ ./clients/memdump.exe --servers="localhost:22122"|wc -l
    memdump: memcache error A TIMEOUT OCCURRED
    11928

    Not sure what the timeout is about, but hey--- it's running on Windows! I'll continue investigating how to get this running better.

    Stay tuned.

    Current Mood: cheerful
    Sunday, November 15th, 2009
    3:21 pm
    Memcached Functions For MySQL 1.1 Released
    I'm pleased to announce the release of Memcached Functions for MySQL version 1.1. I realized in the past few weeks, while writing my latest book "Expert PHP and MySQL", that there was no way to obtain the CAS value of a cached item in order to successfully use the function memc_cas(). So, I decided to create a new function, memc_get_cas(), which obtains the CAS value for an item so you can subsequently use this value in a memc_cas() call, which is shown in the example below:

    mysql> select memc_get_cas('t1');
    +--------------------+
    | memc_get_cas('t1') |
    +--------------------+
    |                  3 | 
    +--------------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_get('t1');
    +----------------+
    | memc_get('t1') |
    +----------------+
    | new value      | 
    +----------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_cas('t1', 'change me', 1);
    +--------------------------------+
    | memc_cas('t1', 'change me', 1) |
    +--------------------------------+
    |                              0 | 
    +--------------------------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_cas('t1', 'change me', 3);
    +--------------------------------+
    | memc_cas('t1', 'change me', 3) |
    +--------------------------------+
    |                              1 | 
    +--------------------------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_get('t1');
    +----------------+
    | memc_get('t1') |
    +----------------+
    | change me      | 
    +----------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_get_cas('t1');
    +--------------------+
    | memc_get_cas('t1') |
    +--------------------+
    |                  4 | 
    +--------------------+
    1 row in set (0.00 sec)
    
    --### someone else makes a change with another client! ###
    
    mysql> select memc_cas('t1', 'cas changed value yet again', 4);
    +---------------------------------------------------+
    | memc_cas('t1', 'cas changed value yet again', 93) |
    +---------------------------------------------------+
    |                                                 0 | 
    +---------------------------------------------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_get('t1');
    +-------------------------+
    | memc_get('t1')          |
    +-------------------------+
    | someone else changed me | 
    +-------------------------+
    1 row in set (0.00 sec)
    
    mysql> select memc_get_cas('t1');
    +--------------------+
    | memc_get_cas('t1') |
    +--------------------+
    |                  5 | 
    +--------------------+
    1 row in set (0.00 sec)
    


    As you can see, the CAS value for the item cached with the key 't1', 3 is returned. The call to memc_get() returns the current value of 't1', 'new value'. Next, memc_cas() is called using the CAS value of 1, which does not work since it's not t1's current CAS value. However, the next call to memc_cas() uses 3 as the CAS value, which succeeds. Next, memc_get() shows the value has been changed by the previous memc_cas() call as well as memc_get_cas() showing that the CAS value has been incremented to 4. At this point, even though you don't see it, another client calls memc_set() for t1. This makes it so the subsequent call to memc_cas() using the CAS value of 4 fails because the CAS value for t1 has been incremented due to the other client's change. And the call to memc_get() and memc_get_cas() reveals that in fact the changes from the other client occurred and are the reason for memc_cas() not succeeding.

    To find the code, please visit: https://launchpad.net/memcached-udfs

    Enjoy!

    Current Mood: chipper
    Monday, November 9th, 2009
    9:43 am
    memcached 1.4.3 released
    Over the weekend, memcached 1.4.3 was released, as well, the memcached.org website has a new face! This includes a lot of great features including SASL authentication! Not to mention, libmemcached as of last week (Thanks Trond!) added support for SASL. Dustin added support in spymemcached (Java client) several weeks ago as well. For more info, I wrote up an article on <href='http://blog.northscale.com/northscale-blog/2009/11/sasl-memcached-now-available.html'>http://blog.northscale.com</a> about how to set up memcached to utilize SASL.

    Current Mood: cheerful
    Monday, November 2nd, 2009
    8:28 am
    FederatedX now part of MariaDB!
    I'm extremely happy to announce that the MariaDB project has integrated FederatedX into the main tree and has replaced the old, un-maintained Federated storage engine! This means that from now on, I will target any FederatedX changes and enhancements for MariaDB since it will be easier than having to try to make it run as a pluggable storage engine. This also means I will have another reason why I should keep this project moving forward. I will still provide the ability for anyone who wants to use it as a pluggable engine (not that difficult) so this can be loaded with MySQL as well.

    Also changed: I changed to using the BSD license for FederatedX.

    For Drizzle, I will need to rewrite a good part of the code base to use libdrizzle as well as the new storage engine interface, so they will be somewhat separate projects -- though I'll do my best to keep them the same single project.

    I want to thank Monty Widenius and Antony Curtis for fixing some small bugs in order to get this merged!

    If anyone has a feature request, just let me know.

    The post on this news can also be found at http://askmonty.org/wiki/index.php/MariaDB_versus_MySQL

    Current Mood: cheerful
    Wednesday, October 21st, 2009
    12:16 pm
    memcached Functions for Drizzle now in main tree!
    What a great day! I see that the drizzle team has merged in my (and Padraig O'Sullivan's) memcached Functions for Drizzle (UDFs). I'm really glad to have this in drizzle now as it adds a means of interacting with memcached from within Drizzle. I have most functions from the MySQL branch implemented now as well. I'm extremely grateful to Padraig O'Sullivan for getting this project off the ground. I was a bit stuck with the new API and C++ when I first attempted these and he designed the class setup and had the major functions working which I then picked up and added more functions as well as tests. I was also glad to have the drizzle team add in my sleep() UDF which allowed me to test expirations in these memcached functions.

    These functions have some similar, but very little code from the memcached Functions for MySQL. The new UDF API is completely different than MySQL's UDF API. You have to create a class for each function that is a derived item class. Gone are the function_init, funciton (value), function_deinit setup-- now the main logic is all implemented in value *method*.

    These functions are really useful: You aren't tied to a particular client language. Say for instance you have an application that doesn't yet have a client to Drizzle (though, most languages are supported). This solves that problem in that the UDFs use libmemcached. You can also construct queries that use a table of IDs (fast lookup) to pull from memcached several items at once in an aggregate query which is really useful. You could effectively use drizzle as a relational organizer of data you have put into a memcached cloud.

    I'll be continuing to add features from the MySQL memcached functions as well as add the work I've completed need to get released, which is utilizing Trond Norbye's great work with connection pooling, which Padraig and I will eventually want to use one of the C++ map classes to solve.

    You can use these functions, as well as Drizzle by visiting:

    https://code.launchpad.net/drizzle

    Current Mood: chipper
    Monday, October 19th, 2009
    10:16 am
    moxi 0.10.0 Released!
    Per Northscale's blog as of Friday evening (http://blog.northscale.com/northscale-blog/2009/10/moxi-0100-r.html). Some new features, enhancements and bugfixes:

    * No more dependency on glib due to using an internal hashtable
    * The build has been simplified and compiles on several platforms including the picky ICC!
    * Synced up with memcached 1.4.1
    * More improvements to stats

    Go get the code at http://labs.northscale.com/moxi/moxi-0.10.0.tar.gz !

    Current Mood: chipper
[ << Previous 20 ]
About LiveJournal.com