Skip to content

Instantly share code, notes, and snippets.

@pauldardeau
pauldardeau / contentcompression.py
Created October 3, 2016 22:51
a quick look at swift content compression middleware
# Copyright (c) 2010-2016 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@pauldardeau
pauldardeau / gist:559048ef35ce57cb4fb940bfce139f0d
Last active September 13, 2016 00:23
Swift data file path decoded
Example of decoded full data file path in Swift
===============================================
/srv/node/sdb1/objects/884/963/dd001dbc81e220b9368528fc70c7b963/1471554845.30599.data
--------- ^ ^ ^ ^ ^ ---------------- ^
^ | | | | | ^ |
| | | | | | | |
| | | | | | | |
devices | | | | | | |
dir | | | | | | |
Multi-Swift
===========
What
----
What does it take to be able to run multiple Swift clusters on shared hardware?
Assumptions
-----------
(a) Each cluster would have dedicated disk drives for storing data
XFS - http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure/tmp/en-US/html/Extended_Attributes.html
The attribute names can be up to 256 bytes in length, terminated by the first 0 byte. The intent is that they be printable ASCII (or other character set) names for the attribute. The values can be up to 64KB of arbitrary binary data.
Linux - http://man7.org/linux/man-pages/man7/xattr.7.html
The VFS imposes limitations that an attribute names is limited to 255
bytes and an attribute value is limited to 64 kB.
In the current ext2, ext3, and ext4 filesystem implementations, the
total bytes used by the names and values of all of a files extended
attributes must fit in a single filesystem block (1024, 2048 or 4096
bytes, depending on the block size specified when the filesystem was
@pauldardeau
pauldardeau / gist:c23278b694382018aa3bcf23cf6e9704
Created August 18, 2016 20:03
swift proxy server request dispatch
swift/proxy/server.py
=====================
Application#__call__
Application#handle_request
Application#get_controller
InfoController /info
AccountController (no container and no object)
ContainerController (no object)
ReplicatedObjectController (depending on policy: see ObjectControllerRouter in controllers/obj.py)
Read from filesystem extended attributes (through diskfile.py) for a HEAD request
Written to filesystem extended attributes (through diskfile.py) as part of a POST request
To set custom object metadata - https://prosuncsedu.wordpress.com/2015/12/09/set-metadata-on-openstack-swift-objects/
swift/obj/server.py
=====================
Verify that tempurl is in proxy pipeline
Add 'methods' to tempurl config section in proxy-server.conf
[filter:tempurl]
use = egg:swift#tempurl
methods = GET HEAD PUT DELETE POST
swift post -m "Temp-URL-Key: my_super_secret_key"
curl -i http://localhost:6030/recon/???
From http://docs.openstack.org/developer/swift/admin_guide.html
The following metrics and telemetry are currently exposed:
Request URI Description
/recon/load returns 1,5, and 15 minute load average
/recon/mem returns /proc/meminfo
/recon/mounted returns ALL currently mounted filesystems
swift-recon --all
===============================================================================
--> Starting reconnaissance on 4 hosts (object)
===============================================================================
[2016-07-25 19:32:32] Checking async pendings
[async_pending] - No hosts returned valid data.
===============================================================================
[2016-07-25 19:32:32] Checking auditor stats
[ALL_auditor] - No hosts returned valid data.
[ZBF_auditor] - No hosts returned valid data.
curl http://127.0.0.1:8080/info
{
"bulk_delete": {
"max_failed_deletes": 1000,
"max_deletes_per_request": 10000
},
"versioned_writes": {},
"container_quotas": {},
"crossdomain": {},