]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/manypools.py
2 Force pg creation on all osds
4 from teuthology
import misc
as teuthology
5 from teuthology
.orchestra
import run
8 log
= logging
.getLogger(__name__
)
10 def task(ctx
, config
):
12 Create the specified number of pools and write 16 objects to them (thereby forcing
13 the PG creation on each OSD). This task creates pools from all the clients,
14 in parallel. It is easy to add other daemon types which have the appropriate
15 permissions, but I don't think anything else does.
16 The config is just the number of pools to create. I recommend setting
17 "mon create pg interval" to a very low value in your ceph config to speed
20 You probably want to do this to look at memory consumption, and
21 maybe to test how performance changes with the number of PGs. For example:
27 mon create pg interval: 1
34 log
.info('creating {n} pools'.format(n
=config
))
38 client_roles
= teuthology
.all_roles_of_type(ctx
.cluster
, 'client')
39 log
.info('got client_roles={client_roles_}'.format(client_roles_
=client_roles
))
40 for role
in client_roles
:
41 log
.info('role={role_}'.format(role_
=role
))
42 (creator_remote
, ) = ctx
.cluster
.only('client.{id}'.format(id=role
)).remotes
.keys()
43 creator_remotes
.append((creator_remote
, 'client.{id}'.format(id=role
)))
45 remaining_pools
= poolnum
47 while (remaining_pools
> 0):
48 log
.info('{n} pools remaining to create'.format(n
=remaining_pools
))
49 for remote
, role_
in creator_remotes
:
50 poolnum
= remaining_pools
52 if remaining_pools
< 0:
54 log
.info('creating pool{num} on {role}'.format(num
=poolnum
, role
=role_
))
59 'osd', 'pool', 'create', 'pool{num}'.format(num
=poolnum
), '8',
63 '--pool', 'pool{num}'.format(num
=poolnum
),
64 'bench', '0', 'write', '-t', '16', '--block-size', '1'
68 log
.info('waiting for pool and object creates')
69 poolprocs
[remote
] = proc
71 run
.wait(poolprocs
.values())
73 log
.info('created all {n} pools and wrote 16 objects to each'.format(n
=poolnum
))