Merge lp://staging/~niemeyer/juju-core/even-faster-bootstrap into lp://staging/~juju/juju-core/trunk
Proposed by
Gustavo Niemeyer
Status: | Merged |
---|---|
Merged at revision: | 582 |
Proposed branch: | lp://staging/~niemeyer/juju-core/even-faster-bootstrap |
Merge into: | lp://staging/~juju/juju-core/trunk |
Diff against target: |
18 lines (+7/-1) 1 file modified
environs/cloudinit/cloudinit.go (+7/-1) |
To merge this branch: | bzr merge lp://staging/~niemeyer/juju-core/even-faster-bootstrap |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+126524@code.staging.launchpad.net |
Description of the change
environs/cloudinit: prealloc smaller journal files
Prealloc 1M journal files upfront, to prevent mongo from doing
that and allocating 100M+ files which take a while to be created.
Let's keep an eye on the effects this will have in practice in
the form of slow-downs while the database itself has to allocate
the next file.
To post a comment you must log in.
Reviewers: mp+126524_ code.launchpad. net,
Message:
Please take a look.
Description:
environs/cloudinit: prealloc smaller journal files
Prealloc 1M journal files upfront, to prevent mongo from doing
that and allocating 100M+ files which take a while to be created.
Let's keep an eye on the effects this will have in practice in
the form of slow-downs while the database itself has to allocate
the next file.
https:/ /code.launchpad .net/~niemeyer/ juju-core/ even-faster- bootstrap/ +merge/ 126524
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6569060/
Affected files: cloudinit/ cloudinit. go
A [revision details]
M environs/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: environs/ cloudinit/ cloudinit. go cloudinit/ cloudinit. go' cloudinit/ cloudinit. go 2012-09-24 21:10:48 +0000 cloudinit/ cloudinit. go 2012-09-26 18:18:08 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -184,7 +184,13 @@
}
func addMongoToBoot(c *cloudinit.Config) error { juju/db/ journal" , lib/juju/ db/journal/ prealloc. 0", lib/juju/ db/journal/ prealloc. 1", lib/juju/ db/journal/ prealloc. 2", NewService( "juju-db" )
- addScripts(c, fmt.Sprintf("mkdir -p /var/lib/juju/db"))
+ addScripts(c,
+ "mkdir -p /var/lib/
+ // Otherwise we get three files with 100M+ each, which takes time.
+ "dd bs=1M count=1 if=/dev/zero of=/var/
+ "dd bs=1M count=1 if=/dev/zero of=/var/
+ "dd bs=1M count=1 if=/dev/zero of=/var/
+ )
svc := upstart.
conf := &upstart.Conf{
Service: *svc,