MyOSS Planet Feeds

Ditesh Kumar: Hitchens, 1949-2011

MyOSS Planet Feeds - 30 min 34 sec ago
“The only position that leaves me with no cognitive dissonance is atheism. It is not a creed. Death is certain, replacing both the siren-song of Paradise and the dread of Hell. Life on this earth, with all its mystery and … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: The Chilli Rush Experience

MyOSS Planet Feeds - 30 min 34 sec ago
I just had an orgasmic chilli high at The Chilli Rush. I came to know of the outlet through colleagues and given my attraction to all things spicy, my interest was piqued. The outlet serves pretty good food at ordinary … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: To Hitch

MyOSS Planet Feeds - 30 min 34 sec ago
Who can forget Hitchens iconic phrase: “That which can be asserted without evidence, can be dismissed without evidence”? He’s easily one of the most prominent intellectuals and accomplished orators of the 21st century. Yet, it has been recently, in the … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: There needs to be a better Jobstreet

MyOSS Planet Feeds - 30 min 34 sec ago
I’ve been hiring developers for a number of years now. Jobstreet is generally the go-to hiring portal. Here’s the resume of the median candidate I find on Jobstreet: Name, race and religion (apparently, race and religion matter enough to employers … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: Product Evaluation 101 (from the other side of the fence)

MyOSS Planet Feeds - 30 min 34 sec ago
Been evaluating products for the last couple weeks. Here are some observations: Have videos that show the product at work. I can only read/watch so much marketing talk (it’s always the same talk). Show me videos and give me the option … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: Google Plus Gets a +1

MyOSS Planet Feeds - 30 min 34 sec ago
Note: This is a long read, but if you make it to the end, I’d appreciate your comments Google+ is the latest social offering from Google. It was launched end June, and has had a rapid ramp-up with an estimated … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: Console.log-ing objects

MyOSS Planet Feeds - 30 min 34 sec ago
Console logging object’s is straightforward in Node.js. A basic console.log(object) works well in printing out member variables and functions of an object: var obj = { "name": "ditesh", "age": 13 }; console.log(obj); // Outputs { name: 'ditesh', age: 13 } … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: Bersih 2.0

MyOSS Planet Feeds - 30 min 34 sec ago
Today was Bersih’s peaceful rally in Kuala Lumpur, Malaysia’s capital. Approximately 50,000 Malaysians turned up to support Bersih’s call for free and fair elections, despite water cannons, tear gas and mass arrests by the police. There have been many videos … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: Implementing UIDL

MyOSS Planet Feeds - 30 min 34 sec ago
I was trying to figure out how to implement the UIDL command as part of a POP3 daemon I am building using Node.js. UIDL is an optional command in RFC 1939, but many POP3 clients use it in the leave-message-on-server … Continue reading →
Categories: MyOSS Planet Feeds

Ditesh Kumar: Tough & Competent

MyOSS Planet Feeds - 30 min 34 sec ago
In 1967, a cabin fire in Apollo 1, scheduled to be the first manned lunar landing program, killed all three cabin members. Gene Krantz, most famously known as NASA’s flight director during the Apollo 13 manned mission, responded to the … Continue reading →
Categories: MyOSS Planet Feeds

Seymour Cakes: Node.js express file upload -- uploading file the easy way

MyOSS Planet Feeds - Mon, 2012-02-06 18:31
Forget all those old example on how to upload file. Express provides a very easy and simple to use file upload feature that every newbie (like me) should know and use.

Step 1:
Your form must be multipart.

<form  enctype="multipart/form-data" ...>
<input name="uploadfile" type="file />
Step 2:
Here comes the req.files magic.

app.post('/upload', function(req, res) {     console.log( req.files.uploadfile );     console.log( req.files.uploadfile.name );
     // use fs.rename to move the file and unlink after that});

Internally express is using formidable to do handle the file upload. But it's a surprise to me that formidable doc is a piece of shit, and express is obviously not advertising this feature enough.
Categories: MyOSS Planet Feeds

Seymour Cakes: Node.js sendfile and Forbidden error

MyOSS Planet Feeds - Mon, 2012-02-06 06:39
If you are getting "Forbidden" error whenever you are trying to use res.sendfile, it's probably because you are using relative path. This is a potential security hole hence it's "Forbidden".

So instead of res.sendfile( __dirname + "/../public/home.html"), use the path module to normalize the path to the file. Like the below,


path = require('path');var filepath = path.normalize( __dirname + "/../public/home.html");res.sendfile( filepath );
Categories: MyOSS Planet Feeds

Muhammad Shahriman (Yondie): My New N9. The Half-Cooked Distro

MyOSS Planet Feeds - Mon, 2012-02-06 01:23

I like my N900 very much, I mean not many people can go around spawn a shell on their palms right?  Sadly althought in my humble opinion N900 is the best thing a phone can offer (fully total control on the phone, straight forward cross compiling like u did on your normal nix unlike the other linux

However it is regret to say that every  awesome stuff in the world have it's own Achilles Heel . (The memory is small, the stock speed of the CPU is only 600Mhz, and the usb female charger port is always on the loose).

So I decided to give myself an upgrade to N9. the Supposely to be the successor for N900. with 1Ghz Proc and 1 Gig Ram should have some deep impact right?
So here is the Pros and COns for N9.
  1. It`s Faster, Amoled
  2. Multitouch all u need is a swipe.
Now here`s the Bad thing ...
1. Half Ass Cooked OSThe moment u enabled Developer mode. U realise that the Phone is bundled with Half-Ass determination unlike the N900. Default repo is worst. U didn`t even have the basic unzip package is not available. CMS tool such as svn and git are borked . It's much better to compile everything  yourself rather then finding the correct Repo.
2. Limited root even in a developer mode. 
This is most likely due to Aegis Security Framework dat is similliar towards SE-Linux. But possess a lot of problem. Any unsigned binary dat did n `t registered with Aegis won`t be executed. Or any code-execution that required root privileged such as raw socket won`t be able to done. Ping is accepted since it's in the Aegis Whitelist. Luckily it was not dat much hassle . There are few tricks u can do ..
-  Using Taviso http://seclists.org/fulldisclosure/2010/Oct/257 (Find the allowed suid ) -  Flash the firmware back and then apply the open-mode patch. http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/
3. No external mmc slot and using microsim instead of normal sim.. (Defakkk?)
So there you go my review on N9. It's really a superb phone that will be abandoned by its maker but not it`s user.

Categories: MyOSS Planet Feeds

Colin Charles: Managing MySQL with Percona Toolkit by Frédéric Descamps

MyOSS Planet Feeds - Sun, 2012-02-05 23:58

Frédéric Descamps of Percona.

Percona Toolkit is Maatkit & Aspersa combined. Opensource and the tools are very useful for a DBA.

You need Perl, DBI, DBD::mysql, Term::ReadKey. Most tools are written in Perl, and whatever is in Bash is being re-written in Perl. There is also a tarball or RPM or DEB packages.

Know your environment. The hardware & OS are crucial for you to know. How much memory/CPU do you use? Do you use swap? Is this a physical/virtual machine? Do you have free space? What kind of RAID controller? Volumes? Disk? What about the network interfaces? What IO schedulers are used? Which filesystem is the data stored on? To answer all that, just use pt-summary.

Know your MySQL environment. Version? Build? How many databases? Where is the data directory? What about replication? What are key InnoDB settings? Storage engine in use? Index type? Foreign keys? Full text indexes? To answer all this and more use pt-mysql-summary.

pt-slave-find shows you the topology and replication hierarchy of your MySQL replication instances. An inventory of replicas!

Where is my disk I/O going? Use pt-diskstats which is an improved iostat. There is pt-ioprofile but it can be dangerous in production.

Now its time to get more intimate with your database. Let’s try to find the answer to these questions: how are the indexes used? Are there duplicate keys? Which queries are eating most of the resources? You can use pt-duplicate-key-checker to check for duplicate/redundant indexes or foreign keys. pt-index-usage can tell you which indexes are unused. If you think you have bad SQL, check out pt-query-advisor.

You can use pt-query-digest to analyze the slow query log and show a profile of the workload. You mostly use this with slow query logs & tcpdump’s. Be careful when you have dropped packets — results may tend to be fake then!

After all this, its time to maintain your environment.

pt-deadlock-logger checks InnoDB status to log MySQL deadlock information. It needs to run continually to capture things.

pt-fk-error-logger extracts and logs MySQL foreign key errors.

pt-online-schema-change to alter tables. It makes a “shadow copy” and swaps them. Extremely useful for large, long-running ALTER. Facebook uses the same technique.

Validate your upgrades as upgrades are the leading cause of downtime. Are queries using different indexes? Is query execution plan different? New errors? See pt-upgrade for this. Best to run this on a third machine (i.e. the old machine and a new machine to see how it goes).

Verify replication integrity – pt-table-checksum. Perform an online replication consistency check or checksum MySQL tables efficiently on one or many servers. Use it routinely (mandatory for 95% of MySQL users). Put it in a weekly crontab. Repair differences with pt-table-sync.

Repair out-of-sync replicas – pt-table-sync

Measure delay acfurately – pt-heartbeat

Deliberately delay replication – pt-slave-delay

Watch & restart MySQL replication after errors – pt-slave-restart

When there are problems, get the symptoms when it hurts. Look at pt-stalk (wait for a condition to occur them begin collecting data – eg. everytime the threads go over 2,000 you have a problem, so it collects stuff – it calls pt-collect), pt-collect (collect information from a server for some period of time), and pt-sift.

pt-mext looks at many samples of MySQL SHOW GLOBAL STATUS side-by-side. Default STATUS shows counter since the MySQL instances started. It is very helpful to see a delta of recent activity.

The future: pt-query-digest will do query reviews; pt-stalk will do “magical fault detection algorithm”. Its all opensource and its all on Launchpad at lp:percona-toolkit.

Related posts:

  1. Practical MySQL Indexing guidelines by Stéphane Combaudon
  2. Replication features of 2011 by Sergey Petrunia
  3. MySQL synchronous replication in practice with Galera by Oli Sennhauser


Categories: MyOSS Planet Feeds

Colin Charles: Replication features of 2011 by Sergey Petrunia

MyOSS Planet Feeds - Sun, 2012-02-05 22:32

Sergey Petrunia of the MariaDB project & Monty Program.

MySQL 5.5 GA at the end of 2010. MariaDB 5.3 RC towards the end of 2011 (beta in June 2011).

MySQL 5.5 is merged to Percona Server 5.5 which included semi-sync replication, slave fsync options, atuomatic relay log recovery, RBR slave type conversions (question if this is useful or not), individual log flushing (very useful, but not many using), replication heartbeat, SHOW RELAYLOG EVENTS. About 2/3rds of the audience use MySQL 5.5 in production, with only 2 people using semi-sync replication.

MariaDB 5.3 brings replication features brings group commit in the binary log, which is merged into Percona Server 5.5. Checksums for binlog events which is merged from MySQL 5.6. Sergey goes in-depth about the group commit for the binary log. To find out a little more about MariaDB replication changes, see Replication in the Knowledgebase.

There are several implementations of group commit. Facebook started it, followed by MariaDB & Oracle. Percona 5.5 is GA so the feature is there, its not in MySQL 5.6 (yet?), and MariaDB 5.3 is where its at. Seems like the MariaDB implementation is the best so far – refer to the Facebook benchmark performed by Mark Callaghan.

Annotated RBR poses a compatibility problem. MariaDB 5.3 has annotate_rows, while MySQL 5.6 has rows_query event. They are different events. So you cannot have a MariaDB 5.3 master and a MySQL 5.6 slave at this moment. So MySQL 5.6 will have a flag to mark “ignorable” binlog events which will be merged into MariaDB and this will make binary logs compatible again.

There is now also optimized RBR for tables with no primary key.

MySQL 5.6 also has crash-safe slave (replication information stored in tables). Crash-safe master (binary log recovery if the server starts & sees the binary log is corrupted). Parallel event execution is something that is new in MySQL 5.6 which is the most important feature for Sergey.

Pre-heating: There is mk-slave-prefetch (famous quote: “Please don’t use mk-slave-prefetch on #MySQL unless you are Facebook.”). There is replication booster by Yoshinori Matsunobu. There is a Python version of mk-slave-prefetch that Facebook uses.

Related posts:

  1. MariaDB 5.3 query optimizer by Sergey Petrunia
  2. Where is MariaDB today?
  3. Building simple & complex replication clusters with Tungsten Replicator by Giuseppe Maxia


Categories: MyOSS Planet Feeds

Colin Charles: MySQL Creatively in a Sandbox by Giuseppe Maxia

MyOSS Planet Feeds - Sun, 2012-02-05 21:57

Giuseppe Maxia of Continuent and long time creator of MySQL Sandbox.

Only works on Unix-like servers. Works with MySQL, Percona & MariaDB servers. MySQL server has the data directory, the port and the socket – you can’t share these.

To use it: make_sandbox foo.tar.gz. Then just do ./use.

$SANDBOX_HOME is ~/sandboxes. You can also create ~/opt/mysql/ and if you have MySQL 5.0.91 binary in that directory, you can just do “sb 5.1.91″.

Sandbox has features to start replication systems as well. You can have varying master/slave setups with varying versions as well (good idea to test from MySQL -> MariaDB master->slave for migration).

You can now also play with tungsten-sandbox, which is a great way to start playing with Tungsten Replicator (see documentation and tungsten-toolbox). There is apparently also a MySQL Cluster sandbox tool that someone is working on.

 

Related posts:

  1. Building simple & complex replication clusters with Tungsten Replicator by Giuseppe Maxia
  2. MySQL HA reloaded by Ivan Zoratti
  3. MySQL synchronous replication in practice with Galera by Oli Sennhauser


Categories: MyOSS Planet Feeds

Colin Charles: Optimizing your InnoDB buffer pool usage by Steve Hardy

MyOSS Planet Feeds - Sun, 2012-02-05 21:29

Steve Hardy of Zarafa.

Work that has been done to make Zarafa better. Why do you optimise your buffer pool? To decrease your I/O load. How can you do it? Buy more RAM, page compression, less (smaller) data, rearrange data.

MariaDB or Percona Server allows you to inspect your buffer pool (unsure if this is now available in MySQL 5.6). Giuseppe in the audience says this is available in MySQL 5.6, but Steve used this on MariaDB 5.2.

Strategies to fix it: Make records smaller. Remove indexes if you can use others almost as efficiently. Make records that are accessed around the same time have a higher chance of being on the same page. Use page compression. Buy more RAM. Try Batched Key Access (BKA) in MariaDB 5.3+.

Best to view the presentation since there are specific examples that speak about how Zarafa solves their problems like a user trying to sort their email, etc.

Related posts:

  1. Batched Key Access Join Previews available
  2. MariaDB 5.3 query optimizer by Sergey Petrunia
  3. MariaDB/MySQL users in Paris & Brussels


Categories: MyOSS Planet Feeds

Colin Charles: Practical MySQL Indexing guidelines by Stéphane Combaudon

MyOSS Planet Feeds - Sun, 2012-02-05 21:01

Stéphane Combaudon of Dailymotion.

Index: separate data structure to speed up SELECTs. Think of index in a book. In MySQL, key=index. Consider that indexes are trees.

InnoDB’s clustered index – data is stored with the Primary Key (PK) so PK lookups are fast. Secondary keys hold the PK values. Designing InnoDB PK’s with care is critical for performance.

An index can filter and/or sort values. An index can contain all the fields needed for the query you don’t need to go to the table (a covering index).

MySQL only uses 1 index per table per query (not 100% true – OR clauses), so think of a composite index when you can. Can’t index TEXT fields (use a prefix). Same for BLOBs and long VARCHARs.

Indexes: speed up queries, increases the size of your dataset, slows down writes. How big is the write slowdown? Simple test by Stephane, for in-memory workloads he says adding 2 keys makes performance 2x worse; for on-disk workloads he says its 40x worse. Never neglect the slowdown of your writes when you have an index. There is a graph in the slidedeck.

What is a bad index? Unused indexes. Redundant indexes. Duplicate indexes.

Indexing is not an exact science, but guessing is probably not the best way to design indexes. Always check your assumptions – EXPLAIN does not tell you everything, time your queries with different index combinations, SHOW PROFILES is often valuable. Slow query log is a good place to start.

Many slides with examples, so I hope Stephane posts the deck soon. If possible, try to sort & filter (an index is not always the best for sorting).

InnoDB’s clustered index is always covering. SELECT by PK is the fastest access with InnoDB.

An index can give you 3 benefits: filtering, sorting, covering.

See Userstats v2 - you need Percona Server or MariaDB 5.2+. See also pt-duplicate-key-checker to find redundant indexes easily. See also pt-index-usage to help answer questions not covered by userstats.

Related posts:

  1. Sphinx user stories by Stéphane Varoqui
  2. Managing MySQL with Percona Toolkit by Frédéric Descamps
  3. MySQL Full Text Search by Alex Rubin


Categories: MyOSS Planet Feeds

Colin Charles: MySQL synchronous replication in practice with Galera by Oli Sennhauser

MyOSS Planet Feeds - Sun, 2012-02-05 20:30

Oli Sennhauser of FromDual.

Synchronous multi-master replication with the Galera plugin. Your application connects to the load balancer and it redirects read/write traffic to the various MySQL Galera nodes. Tested a setup with 17 SQL nodes and you can have even more. Scaling reads and also a little bit for scaling writes is what Galera is good for.

If one node fails, the other two nodes still communicates with each other and the load balancer is aware of the failed node.

Why Galera? There is master-slave replication but its not multi-master, and its asynchronous and you can get inconsistencies. There is master-master replication but its asynchronous and can have inconsistencies and conflicts if you write on both nodes. MHA/MMM/Tungsten are not providing new technology but are based on the MySQL replication technology. MySQL Cluster is another solution but its not InnoDB storage & your need new know-how for Cluster. Also Cluster has problems with fast JOINs. Active/Passive failover clustering, but too often you have resources idling. Schooner being closed & expensive is hard to know much about what they’re doing.

Galera is synchronous & based on InnoDB (others should in theory be possible). Active-active real multi-master topology. True parallel replication on row level. Cluster speaks with each other. There is no slave lag. Won’t lose transactions. Read/write scalability, write throughput can be improved but can’t scale in the way like MySQL Cluster.

Disadvantages? Its not native MySQL binaries/sources but a patch. Codership provides binaries. Higher probability of deadlocks. When you do a full sync (like when a node comes back after downtime), one node is blocked. This is why the minimum you need a 3-node cluster. Also if you do a full sync with a database larger than 50GB, the recommended method is to use mysqldump (which can be very slow). You can use rsync. Percona is working on xtrabackup to do a full sync between nodes.

Setup: 3 nodes are recommended. Or just 2 nodes and one for garbd (Galera Arbitrator Daemon). 2 nodes works but pay attention to a split brain scenario. Go to the Codership website, download their binaries and wsrep (the Galera plug-in). Create your own user on all nodes (don’t use the default root user). You then need to configure my.cnf (there have been discussions for a galera.conf, but Oli just uses my.cnf). Galera works only with InnoDB, so in my.cnf make the default storage engine InnoDB (don’t for example, by accident have MyISAM tables).

The demo has a strange Galera start script, but its not been easy to work. Just start MySQL usually like you would do.

SST is Snapshot State Transfer (SST). Its the initial full sync between the 1st and the other node. SST blocks the donor node (hence why you need 3 nodes). With Galera v2.0, there is also incremental state transfer. It should be GA in February 2012. You can get deltas as opposed to the full sync. You can configure which will be the donor node.

Currently there are 27 variables about Galera in v1.1. You can do it just by doing SHOW GLOBAL VARIABLES LIKE ‘wsrep%’;. The plugin itself, wsrep_provider_options has plenty of options & plenty of room for tuning. SHOW GLOBAL STATUS LIKE ‘wsrep%’; currently has 38 status information fields in Galera v1.1.

For load balancing, you can do it in your application (on your own). You can also use Connector/J which provides load balancing. There is also a PHP MySQLnd that works.

Related posts:

  1. MySQL HA reloaded by Ivan Zoratti
  2. Ticketmaster thrives on MySQL Replication
  3. New MySQL 5.6 Features by Oli Sennhauser


Categories: MyOSS Planet Feeds

Colin Charles: Optimising SQL applications by using client side tools by Mark Riddoch

MyOSS Planet Feeds - Sun, 2012-02-05 19:54

Mark Riddoch of SkySQL.

This was a talk about the future in general. What people would like. Etc. Not about something that exists yet, hence the sparse notes.

Trace statements are good for the “why”. You move on to the debugger, but what is a useful SQL debugger? Profilers addresses the “when”.

SQL developer tools: manually run queries (traditional route for development, effective way to test SQL statements, some indication of performance), server logs (alerts developers of serious issues like the slow query log – identify poorly written queries, requires server access, not effective in a cloud environment (?)), external monitoring (network sniffing of connection packets, Ethereal dissectors – allow individual connections to be traced, no server access, privileged network access, complex to interpret, possibility of packet loss), intrusive tools (insert “proxy” between client & server to intercept all traffic, imposes delay & requires setup modification).

Client-side tools – client modification or hook via connectors (query logging, profiling). The Java connector has profiling. Should there be a connector slow query log? So there’s no requirement for server access and its per client rather than per server.

Plans: roll out connector query logs for Java, C, and scripting languages built on Connector/C. SQL Parser for report generation/fuzzy matching. Create post-processing tools. Query log comparisons – detect fluctuation in execution time, plan flip alerting, replay log.

Related posts:

  1. Open source tools to run a small-medium sized business
  2. Practical MySQL Indexing guidelines by Stéphane Combaudon
  3. Leaving Summer of Code applications to the last minute?


Categories: MyOSS Planet Feeds
Syndicate content