Rexfeng
Shared posts
Notes from the Newb
Notes from the Newb.
I’m relatively new to MySQL having come from the world of embedded micro-databases, and though I’m pretty familiar with a number of database systems, I’ve discovered that I have a lot to learn about MySQL.
As a new member to the Percona team, I thought I’d have an ongoing blog theme titled “Notes from the Noob” and discuss common problems that our consultants have encountered when working with customers who are also new to MySQL. To which end, I’m going to make the assumptions that (1) you use InnoDB as your engine of choice (a database that ain’t ACID ain’t no database) and that (2) you are using the latest release, 5.6.
So last week I polled a number of our senior consultants and asked them, what are the most common mistakes made by our customers who are also new to MySQL? Overwhelming, I heard back that it was using the default settings and not configuring my.cnf to their specific workload. Having said that, one of the dangers of MySQL is that because there are literally hundreds of configurable parameters that can be set, one is inclined to start messing around and thus ending up with worse performance, rather than better.
The key to working with the MySQL configuration file is that a light touch is recommended, and generally only a handful of parameters need be re-defined.
So what are some of more important parameters one should consider changing from the default values?
First and foremost is the system variable innodb_buffer_pool_size. This defines the size of the memory pool used for caching InnoDB tables and indices and its default size is a piddling 128 MB. On a dedicated server, it’s generally a good idea to set this at 70-80% of available memory but remember that InnoDB will take up to an additional 10% for buffers and control structures. The idea is that the more memory allocated to the database, the less I/O you can expect when accessing the same data. Other issues you might want to consider when defining this value is the size of your dataset and whether you will have multiple instances of MySQL running. Be careful though if you plan to have your entire LAMP stack on a single machine, you might end up having competition for memory resources resulting in paging in the operating system thus negating the whole purpose of reducing IO.
Next up would be the system variable, innodb_log_buffer_size which can be important if you expect to be committing large transactions. The idea is that if you do have large transactions, setting this variable high enough will prevent the requirement of writing the log to disk before the transaction is committed. The default value is 8 MB, but if you expect to have larger transactions, you should definitely consider upping the value.
As expected, the innodb_log_file_size represents the size of the log files. The larger the value, the less checkpoint flush activity is needed in the buffer pool thus reducing disk IO. The downside however to a large value is that crash recovery can be slower. The default value is 48MB. As usual, you should do a reality check with regards to your actual workload. If your system is doing mostly reads, you may not need a large value, whereas if you’re storing blobs (which by the way, is generally not a good idea) you may want to have a larger value.
Another system variable to consider is the innodb_flush_log_at_trx_commit, which by default is set to 1, which means that the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file. This is great if you can’t risk losing any data, however it can also come with a serious performance penalty. If you’re able to assume more risk and are able to lose up to a second of data, you might want to consider setting this to either 0 or 2. In the case of small ‘write’ transactions, this can provide significant performance improvements.
If you don’t have many tables in your database, you should be aware of the innodb_file_per_table, which as of 5.6, has a default value of ON. This results in MySQL assigning a separate .ibd file for each table in the database. There are a number of reasons why this can be beneficial, but the primary being that you are able to reclaim disk space. One of the quirks of InnoDB tablespace is that when a record is deleted, disk space is not reclaimed. So how are you able to get back that disk space you ask? Let’s say you have a table called biggiesmall and you have deleted 90% of the records. Simple execute the query, ALTER TABLE biggiesmall ENGINE=InnoDB. This will result in a temporary file being created with only the undeleted records. Once the process in completed, the original table is removed and the temporary table is renamed as the original table.
And finally, the best settings are based upon actual runtime statistics. Monitor and record what happens with your database and base your settings upon real numbers.
The post Notes from the Newb appeared first on MySQL Performance Blog.
The BP oil spill broke a lot of fish hearts
Last December, scientists announced that dolphins in Louisiana were experiencing lung diseases and low birthrates in the wake of the Deepwater Horizon oil spill that released more than 636 million liters of crude oil into the Gulf of Mexico in 2010. Now, researchers have also found evidence of potentially lethal heart defects in two species of tuna and one species of amberjack — all economically important species for commercial fisheries. This news, published in the Proceedings of the National Academy of Sciences today, comes less than a week after the announcement that BP will once again be allowed to explore the Gulf of Mexico for oil.
Inside The Food Court Madness At Flushing's New World Mall
How To Move Like A Pro In Titanfall
Movement is everything in Titanfall. A good player knows how to get around the map with ease, sometimes without ever touching the ground. If you've been having trouble with movement, there's good news: you can learn how to expertly use your jumps, wall-running and jetpacks in Titanfall with some help.
Tiny Super Mario 64 Secrets You May Not Have Noticed
Super Mario 64 didn't skimp out on small details—take, for example, the penguins in Cool Cool Mountain. They do more than just provide you with stars, you know.
Coming Attractions: JFK Will Soon Have Not One, But Two Shake Shacks
[Photo courtesy of Shake Shack]
There is currently a second Shake Shack in the works at JFK, and just like the first one, it's going into Delta's Terminal 4. There's a lot of plywood up at the moment, and no exact opening date yet, but a representative for Shake Shack says it will likely be open by late May or early June. When it does, it will presumably be the second Shake Shack in the world to serve breakfast (namely egg sandwiches), the first being the other JFK outpost at Gate B36.
· @CBCebulski [Twitter]
· All Coverage of Shake Shack [~ENY~]
That's One Way To Build Titanfall's Giant Mech
The end of polio declared in India
In 1988, India had over 200,000 cases of polio reported. For the past three years, they've had 0. At the end of this month, the WHO will announce the end of polio in India.
America experienced the height of polio in the 1940s and '50s, when about 35,000 people became disabled every year. Fear and panic spread and parents were known to warn their children to not drink from public water fountains, avoid swimming pools and stay away from crowded public places like movie theaters. Perhaps the most famous case of polio in America was Franklin Delano Roosevelt, the first president with a significant physical disability.
The development of the Salk and Sabine vaccines helped lead to eradication of polio in the United States in 1979. In India, too, vaccination was critical.
"There were three keys to our success," Kapur says. "Immunize, immunize and immunize."
Vaccines. And now my kids don't die.
Tags: India medicine polio vaccinesLatest trailer for 'X-Men: Days of Future Past' shows just how bleak the future looks
The newest trailer for X-Men: Days of Future Past has hit, and it looks like a true return to form for director Bryan Singer. In this spot, we see for the first time the dystopian future that awaits mutantkind — like in the original 1980 storyline, Bolivar Trask's Sentinels have emerged and are hunting mutants down to the brink of extinction. Many of the major characters from Singer's original run make appearances alongside their First Class forebears, including Hugh Jackman as Wolverine and Halle Berry as a classically punky Storm. The best part, incredibly, is seeing James McAvoy and Michael Fassbender reprise their roles as Professor X and Magneto, putting in pretty amazing performances as two men at the height of their enmity. May...
Titanfall patch helps players escape, crushes bugs under robot boots
N.S.A. Breached Chinese Servers Seen as Security Threat
About That Time Google Spied On My Gmail
I’m reading about how Microsoft read a blogger’s Hotmail (or other Microsoft hosted email) to determine who leaked Microsoft information to that blogger. Microsoft’s response is pathetic, stating that “the privacy of our customers is incredibly important to us” in the same post that explains that they’ll keep doing it.
While I think that doing this is both evil and shortsighted (they lose trust and users), the only thing that surprised me was that they admitted it.
As the Guardian points out, other email providers also reserve the right to do this in their terms of service.
I have first hand knowledge of this. A few years ago, I’m nearly certain that Google accessed my Gmail account after I broke a major story about Google.
A couple of weeks after the story broke my source, a Google employee, approached me at a party in person in a very inebriated state and said that they (I’m being gender neutral here) had been asked by Google if they were the source. The source denied it, but was then shown an email that proved that they were the source.
The source had corresponded with me from a non Google email account, so the only way Google saw it was by accessing my Gmail account.
A little while after that my source was no longer employed by Google.
I certainly freaked out when this happened, but I never said anything about it because I didn’t want people to be afraid to share information with TechCrunch. But I became much more careful to make sure that communications with sources never occurred over services owned by the companies involved in the story.
So, yeah, the Guardian story is accurate.
Update: Google says this never happened (also in a comment below that I just approved). Some of the wording is (just slightly) odd (“opened” denial v. “accessed” accusation) but I assume that was inadvertent and they’re flatly denying this whole story.
Stanford opening new lab to study bad science
Despite the prestige that comes with research being published in peer-reviewed journals like Nature, recent investigation into published studies have found many to be irreproducible or flat-out wrong. Indeed, one groundbreaking stem cell study was recently called into question after researchers were unable to replicate its conclusions, while 120 computer-generated papers were thrown out last month. To help prevent this influx of bad science, Stanford University is launching the Meta-Research Innovation Center (METRIC) to verify the findings of scientific research.
METRIC, The Economist reports, is led by Stanford professor John Ioannidis, an epidemiologist who in 2005 famously wrote "Why most published research findings are false," a...
Don't help your kids with their homework
Don't do your kid's homework. Try not to even help them that much. It's better for their development. And it's better for you not to have to relive your school years. That seems like sensible advice. Until all the other parents in the school start helping their kids on their homework. That's when you'll be tempted. But still, really, don't.
Tags: education parentingWhat they found surprised them. Most measurable forms of parental involvement seem to yield few academic dividends for kids, or even to backfire-regardless of a parent's race, class, or level of education.
Do you review your daughter's homework every night? Robinson and Harris's data, published in The Broken Compass: Parental Involvement With Children's Education, show that this won't help her score higher on standardized tests. Once kids enter middle school, parental help with homework can actually bring test scores down, an effect Robinson says could be caused by the fact that many parents may have forgotten, or never truly understood, the material their children learn in school.
Twitter #Music is officially dead
Months after the company stopped active development on the app, Twitter #Music is being pulled from the App Store today, the company said in a tweet. The app, which attempted to harness conversations around music and artists on Twitter to create a new way to discover music, failed to peel listeners away from the many competing music apps on the market. The app will cease working for existing users on April 18th, the company said.
Later this afternoon, we will be removing Twitter #music from the App Store. If you have the app, it will continue to work until April 18.
— Twitter Music (@TwitterMusic) March 21, 2014
In a separate tweet, the company said it would look for "new ways" to incorporate music into Twitter: "We continue...
Small Town Gets Giant Vending Machine In Place of Grocery Store
As we know, there's pretty much literally nothing vending machines don't dispense these days, but Peter Fox, an electrical engineer in England, has built a giant one that sells everything. It took three years, but it powered up for the first time this week in his small village of Clifton — neighbors can now sidle up and grocery shop by jabbing a bunch of buttons: a loaf of bread (£1.45), milk by the pint (£0.59), six free-range eggs (£1.75), a can of Heinz beans (£0.69), an umbrella (£2.50); it's all there. A security camera monitors the contents, and Fox says he stocks local produce when possible.
Is This the Future of the Village Shop? [Daily Mail]
Read more posts by Clint Rainey
Filed Under: please insert coins, clifton, groceries, vending machines
NYC Reforms Restaurant Inspection System Following Restaurateurs' Outcry
A Glitch in the Hubble Telescope Makes Beautiful Modern Art
You've seen all the mind-boggling space images from the Hubble telescope, so this might seem... bizarre. What looks like a light painting or a computer rendering is an actual image sent back during the Hubble's observing session. This is what happens when the telescope locks onto bad guide star. The European Space Agency explains:
Pizza Week 2014: The Eater Pizza Boat Sets Sail Today at 4:50 p.m.
As a grand finale to Pizza Week, Eater has commandeered one of the East River Ferries for the first ever Pop-Up Pizza Party. There will be free slices from Pizza Bracket favorite Luzzo's, soda, music, Eater swag, and surprises galore. And the best part of all? Eater readers are invited.
Interested parties can join this celebration of pizza and boats by heading to Pier 11 this afternoon and buying a $4 ticket for the 4:50 p.m. ferry. The Pizza Boat will be making the East River Ferry's regular stops in the FiDi, Dumbo, Williamsburg, Long Island City, and Midtown all afternoon, and Eater will be documenting the madness on this very site. It promises to be the greatest floating pizza party that New York City has ever seen.
· East River Ferry [Official Site]
· All Coverage of Eater Pizza Week [~ENY~]
Cupcake ATM Headed For The UES Next Week
Behind the Scenes In Kenji's Home Kitchen (A.K.A. Home of The Food Lab)
VIEW SLIDESHOW: Behind the Scenes In Kenji's Home Kitchen (A.K.A. Home of The Food Lab)
[Photographs: J. Kenji Lopez-Alt]
Editor's Note: In our new Home Kitchen series, we'll be touring the kitchens of SE staffers and contributors. Today we're heading into Kenji's kitchen!
A couple things have changed since I last gave you a virtual tour of my kitchen back in 2010. Most prominently, I've moved. Down the hall. To a nearly identical-but-with-some-important-improvements apartment. The biggest improvement was a slightly more spacious kitchen and a deck where I can test grilled recipes.
I've also collected many more things along the way, which is good and bad. I'm in for some major spring cleaning when my wife and I head out to San Francisco this summer (we're finally getting out of New York!). Some things have been retired, like the frozen cat I had in my freezer for a few months before we could find a suitable burial ground. My taste-tester extraordinaire Dumpling also sadly passed away a few years ago, but there's never a shortage of hungry canine mouths to feed now that Hambone and Yuba are in the picture.
Take a walk through my kitchen and let me show you a bit of my world. It's not nearly as exciting as one could wish for, I imagine.
About the author: J. Kenji Lopez-Alt is the Chief Creative Officer of Serious Eats where he likes to explore the science of home cooking in his weekly column The Food Lab. You can follow him at @thefoodlab on Twitter, or at The Food Lab on Facebook.
Google’s Dominance of the Mobile Ad Market Is Slipping
WSJ Digits (curiously un-bylined):
The global market for mobile ad dollars more than doubled in 2013 to $17.96 billion and it is on pace to hit $31.45 billion in 2014, according to data from eMarketer that was compiled by Statista.
Google’s share fell below 50% in 2013 and is projected to slip further, the data show. Facebook, on the other hand, ramped up quickly last year and its share is expected to top 20% in 2014.
It’s not just that Google’s share keeps falling — it’s that the overall mobile advertising marketing is growing so fast. Financially, Google is still geared for a world where the majority of online use is on PCs.
Iranian Ship, in Plain View but Shrouded in Mystery, Looks Very Familiar to U.S.
The scourge of coffee
Khoi Vinh tells us how he really feels about coffee.
In the West, and particularly in urban centers of the United States, we've turned coffee into not just a daily habit, but a totem of conspicuous consumption. They are "rituals of self-congratulation" (a choice phrase I believe I read from Sam Sifton, but which I can't seem to source) wherein we continually obsess over certain coffee purveyors or certain methods of brewing coffee - each new one more complex, more Rube Goldbergian and more comically self-involved than the previous brewing fad.
I don't drink coffee either (don't even like the smell), but as someone who regularly indulges in other addictions and "rituals of self-congratulation", I don't take issue with other people's enjoyment of coffee...as long as I'm out of earshot when the "perfect grinder for pulling a great shot" discussion starts.
Coffee, like almost everything else these days, is a sport. Everyone has a favorite team (or coffee making method or political affiliation or design style or TV drama or rapper or comic book), discusses techniques and relives great moments with other likeminded fans, and argues with fans of other teams. The proliferation and diversification of media over the past 35 years created thousands of new sports and billions of new teams. These people turned hard-to-find nail polish into a sport. These people support Apple in their battle against Microsoft and Samsung. This guy scouts fashion phenoms on city streets. Finding the best bowl of ramen in NYC is a sport. Design is a sport. Even hating sports is a sport; people compete for the funniest "what time is the sportsball match today? har har people who like sports are dumb jocks" joke on Twitter. Let people have their sports, I say. Liking coffee can't be any worse than liking the Yankees, can it?
Tags: coffee food Khoi Vinh sportsPizza Week: How did burrito giant Chipotle and...
How did burrito giant Chipotle and a small, critically acclaimed pizzeria in Denver pull off a secret joint project? Eater National's Amy McKeever pulls back the curtain on the story of Pizzeria Locale, talking with Chipotle CEO Steve Ells and restaurateurs Bobby Stuckey and Lachlan Mackinnon-Patterson to get the scoop on corporate subterfuge and fast-casual pizza. [-EN-]
[Photo: Adam Larkey/Eater.com]